home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-08-14 | 285.3 KB | 10,187 lines |
- diff -cr --new-file linux-0.9pl1/Makefile linux-0.9pl2/Makefile
- *** linux-0.9pl1/Makefile Thu Jul 28 21:32:48 1994
- --- linux-0.9pl2/Makefile Fri Aug 5 12:58:53 1994
- ***************
- *** 8,14 ****
-
- VERSION = 0
- PATCHLEVEL = 9
- ! SUBLEVEL = 1
-
- all: Version vmlinux
-
- --- 8,14 ----
-
- VERSION = 0
- PATCHLEVEL = 9
- ! SUBLEVEL = 2
-
- all: Version vmlinux
-
- ***************
- *** 76,87 ****
- endif
-
- ifdef CONFIG_AMIGA
- ! BOOTOBJS := tools/amiga/bootstrap.o tools/amiga/get_nlist.o
- ARCHIVES := $(ARCHIVES) amiga/amiga.o
- SUBDIRS := $(SUBDIRS) amiga
- endif
-
- ifdef CONFIG_ATARI
- ARCHIVES := $(ARCHIVES) atari/atari.o
- SUBDIRS := $(SUBDIRS) atari
- endif
- --- 76,88 ----
- endif
-
- ifdef CONFIG_AMIGA
- ! AMIGA_BOOTOBJS := tools/amiga/bootstrap.o tools/amiga/get_nlist.o
- ARCHIVES := $(ARCHIVES) amiga/amiga.o
- SUBDIRS := $(SUBDIRS) amiga
- endif
-
- ifdef CONFIG_ATARI
- + ATARI_BOOTOBJS := tools/atari/bootstrap.o tools/atari/get_nlist.o
- ARCHIVES := $(ARCHIVES) atari/atari.o
- SUBDIRS := $(SUBDIRS) atari
- endif
- ***************
- *** 110,117 ****
- linuxsubdirs: dummy
- set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i; done
-
- ! bootstrap: $(BOOTOBJS)
- ! $(HOSTCC) $(HOSTFLAGS) -o $@ $(BOOTOBJS)
-
- tools/./version.h: tools/version.h
-
- --- 111,129 ----
- linuxsubdirs: dummy
- set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i; done
-
- ! ifdef CONFIG_ATARI
- ! atari_bootstrap: $(ATARI_BOOTOBJS)
- ! $(HOSTCC) $(HOSTFLAGS) -o $@ $(ATARI_BOOTOBJS)
- ! rm -f bootstrap
- ! ln $@ bootstrap
- ! endif
- !
- ! ifdef CONFIG_AMIGA
- ! amiga_bootstrap: $(AMIGA_BOOTOBJS)
- ! $(HOSTCC) $(HOSTFLAGS) -o $@ $(AMIGA_BOOTOBJS)
- ! rm -f bootstrap
- ! ln $@ bootstrap
- ! endif
-
- tools/./version.h: tools/version.h
-
- ***************
- *** 141,164 ****
- $(LIBS) \
- -o vmlinux > System.map
-
- ! # this target just creates an amigados format executable of
- ! # the kernel so that you can run an amigados disassembler on it.
- ! vmlinux.amigados : m68k/head.o init/main.o init/config.o tools/version.o linuxsubdirs
- ! $(HOSTCC) -nostdlib m68k/head.o init/main.o init/config.o \
- ! tools/version.o \
- ! $(ARCHIVES) \
- ! $(FILESYSTEMS) \
- ! $(DRIVERS) \
- ! $(LIBS) \
- ! -o vmlinux.amigados
-
- ! m68k/head.o: m68k/head.S #m68k/assyms.h
- !
- ! m68k/assyms.h: dummy
- ! make -C m68k assyms.h
- !
- ! $(BOOTOBJS): $(BOOTOBJS:.o=.c)
- ! $(HOSTCC) $(HOSTFLAGS) -c $*.c -o $@
-
- fs: dummy
- $(MAKE) $(MFLAGS) linuxsubdirs SUBDIRS=fs
- --- 153,162 ----
- $(LIBS) \
- -o vmlinux > System.map
-
- ! m68k/head.o: m68k/head.S
-
- ! $(AMIGA_BOOTOBJS) $(ATARI_BOOTOBJS): $(AMIGA_BOOTOBJS:.o=.c) $(ATARI_BOOTOBJS:.o=.c)
- ! $(HOSTCC) $(HOSTFLAGS) -c $< -o $@
-
- fs: dummy
- $(MAKE) $(MFLAGS) linuxsubdirs SUBDIRS=fs
- ***************
- *** 181,186 ****
- --- 179,187 ----
- amiga: dummy
- $(MAKE) $(MFLAGS) linuxsubdirs SUBDIRS=amiga
-
- + atari: dummy
- + $(MAKE) $(MFLAGS) linuxsubdirs SUBDIRS=atari
- +
- m68k: dummy
- $(MAKE) $(MFLAGS) linuxsubdirs SUBDIRS=m68k
-
- ***************
- *** 213,222 ****
- depend dep:
- -touch tools/version.h
- for i in init/*.c;do (echo -n init/;$(CPP) -M $(INCFLAGS) $$i); done > .tmpdepend
- ! for i in $(BOOTOBJS:.o=.c); do (echo -n tools/amiga/;$(HOSTCC) $(HOSTINCFLAGS) -M $$i); done >> .tmpdepend
- ! set -e ; for i in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$i dep; done
- $(RM) $(RMFLAGS) tools/version.h
- mv .tmpdepend .depend
-
- ifdef CONFIGURATION
- ..$(CONFIGURATION):
- --- 214,232 ----
- depend dep:
- -touch tools/version.h
- for i in init/*.c;do (echo -n init/;$(CPP) -M $(INCFLAGS) $$i); done > .tmpdepend
- ! $(foreach i, $(SUBDIRS), $(MAKE) $(MFLAGS) -C $i dep ;)
- $(RM) $(RMFLAGS) tools/version.h
- mv .tmpdepend .depend
- +
- + amigadep:
- + ifdef CONFIG_AMIGA
- + for i in $(AMIGA_BOOTOBJS:.o=.c); do (echo -n tools/amiga/;$(HOSTCC) $(HOSTINCFLAGS) -M $$i); done >> .depend
- + endif
- +
- + ataridep:
- + ifdef CONFIG_ATARI
- + for i in $(ATARI_BOOTOBJS:.o=.c); do (echo -n tools/atari/;$(HOSTCC) $(HOSTINCFLAGS) -M $$i); done >> .depend
- + endif
-
- ifdef CONFIGURATION
- ..$(CONFIGURATION):
- diff -cr --new-file linux-0.9pl1/amiga/amicon.c linux-0.9pl2/amiga/amicon.c
- *** linux-0.9pl1/amiga/amicon.c Wed Jun 29 17:27:03 1994
- --- linux-0.9pl2/amiga/amicon.c Sun Aug 14 09:40:05 1994
- ***************
- *** 1519,1525 ****
- */
-
- for (rows = p->fontheight ; rows-- ; dest += bytes)
- ! *dest = *cdat++;
-
- for (i = 1 ; i < p->scr_depth ; i++) {
- dest = p->bitplane[i] + offset;
- --- 1519,1532 ----
- */
-
- for (rows = p->fontheight ; rows-- ; dest += bytes)
- ! switch (mode) {
- ! case DM_COPY:
- ! *dest = *cdat++;
- ! break;
- ! case DM_INVERSE:
- ! *dest = ~*cdat++;
- ! break;
- ! }
-
- for (i = 1 ; i < p->scr_depth ; i++) {
- dest = p->bitplane[i] + offset;
- ***************
- *** 1579,1610 ****
- * d0 -- scratch ; d1 -- count ; d2 -- bytes
- *
- */
- ! __asm__("movel %1,d1 ; beq 5f ; subqw #1,d1\n\t"
- ! "movel %0,a0 ; movel %2,a2 ; movel %3,a3;movel %4,d2\n\t"
- ! "1: moveb a2@+,d0 ; extw d0\n\t"
- ! "cmpb #32,d0 ; jlt 2f ; cmpb #127,d0 ; jge 2f\n\t"
- ! "subb #32,d0 ; jra 3f\n\t"
- ! "2: cmpb #160,d0 ; jlt 1b ; cmpb #255,d0 ; jeq 1b\n\t"
- ! "subb #64,d0\n\t"
- ! "3: lea a3@(d0:w:8),a1 ; movel a0,sp@-\n\t"
- ! " moveb a1@+,a0@; lea a0@(d2:w),a0\n\t" /* 0 */
- ! " moveb a1@+,a0@; lea a0@(d2:w),a0\n\t" /* 1 */
- ! " moveb a1@+,a0@; lea a0@(d2:w),a0\n\t" /* 2 */
- ! " moveb a1@+,a0@; lea a0@(d2:w),a0\n\t" /* 3 */
- ! " moveb a1@+,a0@; lea a0@(d2:w),a0\n\t" /* 4 */
- ! " moveb a1@+,a0@; lea a0@(d2:w),a0\n\t" /* 5 */
- ! " moveb a1@+,a0@; lea a0@(d2:w),a0\n\t" /* 6 */
- ! " moveb a1@+,a0@; lea a0@(d2:w),a0\n\t" /* 7 */
- ! "movel sp@+,a0 ; lea a0@(1),a0 ; dbra d1,1b\n\t"
- ! "5:"
- ! :
- ! : "g" (dest0), "g" (count), "g" (s),
- ! "g" (p->fontdata), "g" ((ulong) bytes)
- ! : "a0", "a1", "a2", "a3", "d0", "d1", "d2");
- ! return;
- }
- #endif
-
- while (count--) {
- c = *(s++); dest = dest0++;
-
- --- 1586,1649 ----
- * d0 -- scratch ; d1 -- count ; d2 -- bytes
- *
- */
- ! switch (mode) {
- ! case DM_COPY:
- ! __asm__("movel %1,d1 ; beq 5f ; subqw #1,d1\n\t"
- ! "movel %0,a0 ; movel %2,a2\n\t"
- ! "movel %3,a3;movel %4,d2\n\t"
- ! "1: moveb a2@+,d0\n\t"
- ! "cmpb #32,d0 ; jlt 2f ; cmpb #127,d0 ; jge 2f\n\t"
- ! "subb #32,d0 ; jra 3f\n\t"
- ! "2: cmpb #160,d0 ; jlt 1b ; cmpb #255,d0 ; jeq 1b\n\t"
- ! "subb #64,d0\n\t"
- ! "3: lea a3@(d0:w:8),a1 ; movel a0,sp@-\n\t"
- ! " moveb a1@+,a0@; lea a0@(d2:w),a0\n\t" /* 0 */
- ! " moveb a1@+,a0@; lea a0@(d2:w),a0\n\t" /* 1 */
- ! " moveb a1@+,a0@; lea a0@(d2:w),a0\n\t" /* 2 */
- ! " moveb a1@+,a0@; lea a0@(d2:w),a0\n\t" /* 3 */
- ! " moveb a1@+,a0@; lea a0@(d2:w),a0\n\t" /* 4 */
- ! " moveb a1@+,a0@; lea a0@(d2:w),a0\n\t" /* 5 */
- ! " moveb a1@+,a0@; lea a0@(d2:w),a0\n\t" /* 6 */
- ! " moveb a1@+,a0@; lea a0@(d2:w),a0\n\t" /* 7 */
- ! "movel sp@+,a0 ; lea a0@(1),a0 ; dbra d1,1b\n\t"
- ! "5:"
- ! :
- ! : "g" (dest0), "g" (count), "g" (s),
- ! "g" (p->fontdata), "g" ((ulong) bytes)
- ! : "a0", "a1", "a2", "a3", "d0", "d1", "d2");
- ! break;
- ! case DM_INVERSE:
- ! __asm__("movel %1,d1 ; beq 5f ; subqw #1,d1\n\t"
- ! "movel %0,a0 ; movel %2,a2\n\t"
- ! "movel %3,a3;movel %4,d2\n\t"
- ! "1: moveb a2@+,d0\n\t"
- ! "cmpb #32,d0 ; jlt 2f ; cmpb #127,d0 ; jge 2f\n\t"
- ! "subb #32,d0 ; jra 3f\n\t"
- ! "2: cmpb #160,d0 ; jlt 1b ; cmpb #255,d0 ; jeq 1b\n\t"
- ! "subb #64,d0\n\t"
- ! "3: lea a3@(d0:w:8),a1 ; movel a0,sp@-\n\t"
- ! " moveb a1@+,d3; notb d3; moveb d3,a0@; lea a0@(d2:w),a0\n\t" /* 0 */
- ! " moveb a1@+,d3; notb d3; moveb d3,a0@; lea a0@(d2:w),a0\n\t" /* 1 */
- ! " moveb a1@+,d3; notb d3; moveb d3,a0@; lea a0@(d2:w),a0\n\t" /* 2 */
- ! " moveb a1@+,d3; notb d3; moveb d3,a0@; lea a0@(d2:w),a0\n\t" /* 3 */
- ! " moveb a1@+,d3; notb d3; moveb d3,a0@; lea a0@(d2:w),a0\n\t" /* 4 */
- ! " moveb a1@+,d3; notb d3; moveb d3,a0@; lea a0@(d2:w),a0\n\t" /* 5 */
- ! " moveb a1@+,d3; notb d3; moveb d3,a0@; lea a0@(d2:w),a0\n\t" /* 6 */
- ! " moveb a1@+,d3; notb d3; moveb d3,a0@; lea a0@(d2:w),a0\n\t" /* 7 */
- ! "movel sp@+,a0 ; lea a0@(1),a0 ; dbra d1,1b\n\t"
- ! "5:"
- ! :
- ! : "g" (dest0), "g" (count), "g" (s),
- ! "g" (p->fontdata), "g" ((ulong) bytes)
- ! : "a0", "a1", "a2", "a3", "d0", "d1", "d2", "d3");
- ! break;
- ! }
- ! return;
- }
- #endif
-
- + printk (__FILE__ ": Line %d shouldn't be executed\n", __LINE__);
- +
- while (count--) {
- c = *(s++); dest = dest0++;
-
- ***************
- *** 1624,1630 ****
-
- cdat = p->fontdata + (c * p->fontheight);
- for (rows = p->fontheight ; rows-- ; dest += bytes)
- ! *dest = *cdat++;
- }
- }
-
- --- 1663,1676 ----
-
- cdat = p->fontdata + (c * p->fontheight);
- for (rows = p->fontheight ; rows-- ; dest += bytes)
- ! switch (mode) {
- ! case DM_COPY:
- ! *dest = *cdat++;
- ! break;
- ! case DM_INVERSE:
- ! *dest = ~*cdat++;
- ! break;
- ! }
- }
- }
-
- diff -cr --new-file linux-0.9pl1/amiga/amiints.c linux-0.9pl2/amiga/amiints.c
- *** linux-0.9pl1/amiga/amiints.c Tue Jun 7 19:38:48 1994
- --- linux-0.9pl2/amiga/amiints.c Sat Aug 6 23:51:49 1994
- ***************
- *** 84,90 ****
-
- /* turn off all interrupts and enable the master interrupt bit */
- custom.intena = 0x7fff;
- ! custom.intreqr = 0x7fff;
- custom.intena = 0xc000;
-
- /* turn off all CIA interrupts */
- --- 84,90 ----
-
- /* turn off all interrupts and enable the master interrupt bit */
- custom.intena = 0x7fff;
- ! custom.intreq = 0x7fff;
- custom.intena = 0xc000;
-
- /* turn off all CIA interrupts */
- diff -cr --new-file linux-0.9pl1/amiga/amikeyb.c linux-0.9pl2/amiga/amikeyb.c
- *** linux-0.9pl1/amiga/amikeyb.c Thu Jul 7 21:18:10 1994
- --- linux-0.9pl2/amiga/amikeyb.c Fri Aug 5 12:46:24 1994
- ***************
- *** 34,49 ****
- /* 04-07 */ '4', '5', '6', '7',
- /* 08-0b */ '8', '9', '0', '-',
- /* 0c-0f */ '=', '\\', K_HOLE, K_P0,
- ! /* 10-13 */ 'q', 'w', 'e', 'r',
- ! /* 14-17 */ 't', 'y', 'u', 'i',
- ! /* 18-1b */ 'o', 'p', '[', ']',
- /* 1c-1f */ K_HOLE, K_P1, K_P2, K_P3,
- ! /* 20-23 */ 'a', 's', 'd', 'f',
- ! /* 24-27 */ 'g', 'h', 'j', 'k',
- ! /* 28-2b */ 'l', ';', '\'', K_HOLE,
- /* 2c-2f */ K_HOLE, K_P4, K_P5, K_P6,
- ! /* 30-33 */ K_HOLE, 'z', 'x', 'c',
- ! /* 34-37 */ 'v', 'b', 'n', 'm',
- /* 38-3b */ ',', '.', '/', K_HOLE,
- /* 3c-3f */ K_PDOT, K_P7, K_P8, K_P9,
- /* 40-43 */ ' ', '?'|0x40, 'I'&0x1f, K_PENTER,
- --- 34,49 ----
- /* 04-07 */ '4', '5', '6', '7',
- /* 08-0b */ '8', '9', '0', '-',
- /* 0c-0f */ '=', '\\', K_HOLE, K_P0,
- ! /* 10-13 */ K(KT_LETTER,'q'), K(KT_LETTER,'w'), K(KT_LETTER,'e'), K(KT_LETTER,'r'),
- ! /* 14-17 */ K(KT_LETTER,'t'), K(KT_LETTER,'y'), K(KT_LETTER,'u'), K(KT_LETTER,'i'),
- ! /* 18-1b */ K(KT_LETTER,'o'), K(KT_LETTER,'p'), '[', ']',
- /* 1c-1f */ K_HOLE, K_P1, K_P2, K_P3,
- ! /* 20-23 */ K(KT_LETTER,'a'), K(KT_LETTER,'s'), K(KT_LETTER,'d'), K(KT_LETTER,'f'),
- ! /* 24-27 */ K(KT_LETTER,'g'), K(KT_LETTER,'h'), K(KT_LETTER,'j'), K(KT_LETTER,'k'),
- ! /* 28-2b */ K(KT_LETTER,'l'), ';', '\'', K_HOLE,
- /* 2c-2f */ K_HOLE, K_P4, K_P5, K_P6,
- ! /* 30-33 */ K_HOLE, K(KT_LETTER,'z'), K(KT_LETTER,'x'), K(KT_LETTER,'c'),
- ! /* 34-37 */ K(KT_LETTER,'v'), K(KT_LETTER,'b'), K(KT_LETTER,'n'), K(KT_LETTER,'m'),
- /* 38-3b */ ',', '.', '/', K_HOLE,
- /* 3c-3f */ K_PDOT, K_P7, K_P8, K_P9,
- /* 40-43 */ ' ', '?'|0x40, 'I'&0x1f, K_PENTER,
- ***************
- *** 67,82 ****
- /* 04-07 */ '$', '%', '^', '&',
- /* 08-0b */ '*', '(', ')', '_',
- /* 0c-0f */ '+', '|', K_HOLE, K_P0,
- ! /* 10-13 */ 'Q', 'W', 'E', 'R',
- ! /* 14-17 */ 'T', 'Y', 'U', 'I',
- ! /* 18-1b */ 'O', 'P', '{', '}',
- /* 1c-1f */ K_HOLE, K_P1, K_P2, K_P3,
- ! /* 20-23 */ 'A', 'S', 'D', 'F',
- ! /* 24-27 */ 'G', 'H', 'J', 'K',
- ! /* 28-2b */ 'L', ':', '"', K_HOLE,
- /* 2c-2f */ K_HOLE, K_P4, K_P5, K_P6,
- ! /* 30-33 */ K_HOLE, 'Z', 'X', 'C',
- ! /* 34-37 */ 'V', 'B', 'N', 'M',
- /* 38-3b */ '<', '>', '?', K_HOLE,
- /* 3c-3f */ K_PDOT, K_P7, K_P8, K_P9,
- /* 40-43 */ ' ', '?'|0x40, 'I'&0x1f, K_PENTER,
- --- 67,82 ----
- /* 04-07 */ '$', '%', '^', '&',
- /* 08-0b */ '*', '(', ')', '_',
- /* 0c-0f */ '+', '|', K_HOLE, K_P0,
- ! /* 10-13 */ K(KT_LETTER,'Q'), K(KT_LETTER,'W'), K(KT_LETTER,'E'), K(KT_LETTER,'R'),
- ! /* 14-17 */ K(KT_LETTER,'T'), K(KT_LETTER,'Y'), K(KT_LETTER,'U'), K(KT_LETTER,'I'),
- ! /* 18-1b */ K(KT_LETTER,'O'), K(KT_LETTER,'P'), '{', '}',
- /* 1c-1f */ K_HOLE, K_P1, K_P2, K_P3,
- ! /* 20-23 */ K(KT_LETTER,'A'), K(KT_LETTER,'S'), K(KT_LETTER,'D'), K(KT_LETTER,'F'),
- ! /* 24-27 */ K(KT_LETTER,'G'), K(KT_LETTER,'H'), K(KT_LETTER,'J'), K(KT_LETTER,'K'),
- ! /* 28-2b */ K(KT_LETTER,'L'), ':', '"', K_HOLE,
- /* 2c-2f */ K_HOLE, K_P4, K_P5, K_P6,
- ! /* 30-33 */ K_HOLE, K(KT_LETTER,'Z'), K(KT_LETTER,'X'), K(KT_LETTER,'C'),
- ! /* 34-37 */ K(KT_LETTER,'V'), K(KT_LETTER,'B'), K(KT_LETTER,'N'), K(KT_LETTER,'M'),
- /* 38-3b */ '<', '>', '?', K_HOLE,
- /* 3c-3f */ K_PDOT, K_P7, K_P8, K_P9,
- /* 40-43 */ ' ', '?'|0x40, 'I'&0x1f, K_PENTER,
- diff -cr --new-file linux-0.9pl1/atari/Makefile linux-0.9pl2/atari/Makefile
- *** linux-0.9pl1/atari/Makefile Wed Jun 29 17:09:10 1994
- --- linux-0.9pl2/atari/Makefile Fri Aug 5 12:46:45 1994
- ***************
- *** 9,15 ****
- include ../MakeVars
-
- OBJS = config.o atakeyb.o ataints.o atacon.o font_8x16.o font_8x8.o \
- ! atapart.o stdma.o atasound.o joystick.o
-
- atari.o: $(OBJS)
- $(LD) -r -o atari.o $(OBJS)
- --- 9,15 ----
- include ../MakeVars
-
- OBJS = config.o atakeyb.o ataints.o atacon.o font_8x16.o font_8x8.o \
- ! atapart.o stdma.o atasound.o joystick.o stram.o
-
- atari.o: $(OBJS)
- $(LD) -r -o atari.o $(OBJS)
- diff -cr --new-file linux-0.9pl1/atari/atacon.c linux-0.9pl2/atari/atacon.c
- *** linux-0.9pl1/atari/atacon.c Wed Jun 29 15:49:16 1994
- --- linux-0.9pl2/atari/atacon.c Sat Aug 6 19:36:19 1994
- ***************
- *** 61,68 ****
-
- #define WHOLE_FONT
-
- - static unsigned long mem_req;
- -
- /* There is no support for fontwidth != 8 now!! (And I guess, it will
- * never come; who needs such stuff??)
- */
- --- 61,66 ----
- ***************
- *** 176,187 ****
- struct display_switch *dispsw; /* pointers to depth specific
- * functions
- */
- };
-
- static struct display disp[NR_CONSOLES];
-
- static struct tt_vid_type tt_video_modes[TT_SHIFTER_NUMMODE] = {
- ! { "stlow", 320 , 200 , 1 } , /* ST-Low */
- { "stmid", 640 , 200 , 2 } , /* ST-Mid */
- { "sthigh", 640 , 400 , 1 } , /* ST-High */
- { "", 000 , 000 , 0 } , /* unused */
- --- 174,188 ----
- struct display_switch *dispsw; /* pointers to depth specific
- * functions
- */
- + u_char *screen_base;
- + u_char *screen_end;
- + ;
- };
-
- static struct display disp[NR_CONSOLES];
-
- static struct tt_vid_type tt_video_modes[TT_SHIFTER_NUMMODE] = {
- ! { "stlow", 320 , 200 , 4 } , /* ST-Low */
- { "stmid", 640 , 200 , 2 } , /* ST-Mid */
- { "sthigh", 640 , 400 , 1 } , /* ST-High */
- { "", 000 , 000 , 0 } , /* unused */
- ***************
- *** 532,551 ****
- */
-
- if (atacon_default_shiftmode != -1)
- ! if ((mono_moni && atacon_default_shiftmode != TT_HIGH) ||
- ! (!mono_moni && atacon_default_shiftmode == TT_HIGH))
- ! atacon_default_shiftmode = -1;
-
- /* Set a default shift mode, if none was given on the command
- * line or that isn't possible.
- */
- if (atacon_default_shiftmode == -1)
- ! atacon_default_shiftmode = mono_moni ? TT_HIGH :
- ! #ifdef CONFIG_ATARI_4PLANE
- ! ST_HIGH;
- ! #else
- ! TT_MID;
- ! #endif
-
- /* Initialize the shift mode, palette bank = 0 */
- shifter_tt.tt_shiftmode = atacon_default_shiftmode << 8;
- --- 533,547 ----
- */
-
- if (atacon_default_shiftmode != -1)
- ! if (mono_moni != (atacon_default_shiftmode == TT_HIGH))
- ! atacon_default_shiftmode = -1;
-
- /* Set a default shift mode, if none was given on the command
- * line or that isn't possible.
- */
- if (atacon_default_shiftmode == -1)
- ! atacon_default_shiftmode
- ! = (shifter_tt.tt_shiftmode >> 8) & 7;
-
- /* Initialize the shift mode, palette bank = 0 */
- shifter_tt.tt_shiftmode = atacon_default_shiftmode << 8;
- ***************
- *** 594,599 ****
- --- 590,597 ----
- static long atacon_init(struct condata *conp, long mem_start)
- {
- int unit = conp - vc_cons;
- + unsigned long mem_req;
- + u_char *screen_base;
-
- /* set up the display defaults */
- detect_video( &disp[unit].scr_height, &disp[unit].scr_width,
- ***************
- *** 668,679 ****
- mem_req = (disp[unit].scr_width/8)*disp[unit].scr_height*
- disp[unit].scr_depth;
- /* locate the bitplane */
- ! mem_start = (mem_start + 7) & ~7; /* round up */
- ! disp[unit].bitplane = (u_char *)mem_start;
- ! mem_start += mem_req;
- ! mymemclear( disp[unit].bitplane, mem_req );
-
- ! shifter_init( (u_long)(disp[unit].bitplane) );
-
-
- #ifdef CURSOR_DELAY_VBL
- --- 666,678 ----
- mem_req = (disp[unit].scr_width/8)*disp[unit].scr_height*
- disp[unit].scr_depth;
- /* locate the bitplane */
- ! screen_base = atari_stram_alloc (mem_req * 2 + 8);
- ! screen_base = (u_char *) (((u_long) screen_base + 7) & ~7);
- ! disp[unit].screen_base = disp[unit].bitplane = screen_base;
- ! disp[unit].screen_end = screen_base + mem_req;
- ! memset (screen_base, 0, mem_req);
-
- ! shifter_init ((unsigned long)screen_base);
-
-
- #ifdef CURSOR_DELAY_VBL
- diff -cr --new-file linux-0.9pl1/atari/ataints.c linux-0.9pl2/atari/ataints.c
- *** linux-0.9pl1/atari/ataints.c Wed Jun 29 15:42:15 1994
- --- linux-0.9pl2/atari/ataints.c Fri Aug 5 12:46:48 1994
- ***************
- *** 13,18 ****
- --- 13,21 ----
- * the normal way. Additionally, all vectors >= 48 are initialized to call
- * trap() instead of inthandler(). This must be changed here, too.
- *
- + * ++andreas: Use software end-of-interrupt mode so that interrupts
- + * with higher priorities are not blocked.
- + *
- * This file is subject to the terms and conditions of the GNU General Public
- * License. See the file README.legal in the main directory of this archive
- * for more details.
- ***************
- *** 32,37 ****
- --- 35,43 ----
- #include <linux/atari_stdma.h>
- #include <linux/bootinfo.h>
-
- + /* isrfunc variables for atari interrupt sources */
- + static isr_node_t *ata_lists[NUM_ATARI_SOURCES];
- +
- /*
- * void atari_init_INTS (void)
- *
- ***************
- *** 60,66 ****
- * non-autovector ints, so we they should jump to the inthandler!
- */
-
- ! for( i = 48; i < 112; ++i )
- vectors[i] = inthandler;
-
- /* All ints are initialized to do nothing by the device independant code
- --- 66,72 ----
- * non-autovector ints, so we they should jump to the inthandler!
- */
-
- ! for( i = 64; i < 112; ++i )
- vectors[i] = inthandler;
-
- /* All ints are initialized to do nothing by the device independant code
- ***************
- *** 68,81 ****
-
- /* Initialize the MFP(s) */
-
- ! mfp.vec_adr = 0x40; /* Automatic EOI-Mode */
- mfp.int_en_a = /* turn off MFP-Ints */
- mfp.int_en_b = 0x00;
- mfp.int_mk_a = /* no Masking */
- mfp.int_mk_b = 0xff;
-
- if (boot_info.bi_atari.model == ATARI_TT) {
- ! tt_mfp.vec_adr = 0x50; /* Automatic EOI-Mode */
- tt_mfp.int_en_a = /* turn off MFP-Ints */
- tt_mfp.int_en_b = 0x00;
- tt_mfp.int_mk_a = /* no Masking */
- --- 74,87 ----
-
- /* Initialize the MFP(s) */
-
- ! mfp.vec_adr = 0x48; /* Software EOI-Mode */
- mfp.int_en_a = /* turn off MFP-Ints */
- mfp.int_en_b = 0x00;
- mfp.int_mk_a = /* no Masking */
- mfp.int_mk_b = 0xff;
-
- if (boot_info.bi_atari.model == ATARI_TT) {
- ! tt_mfp.vec_adr = 0x58; /* Software EOI-Mode */
- tt_mfp.int_en_a = /* turn off MFP-Ints */
- tt_mfp.int_en_b = 0x00;
- tt_mfp.int_mk_a = /* no Masking */
- ***************
- *** 88,93 ****
- --- 94,102 ----
- * enabled in VME mask
- */
- tt_scu.vme_mask = 0x60; /* enable MFP and SCC ints */
- + /* clear the system configuration byte so that
- + rebooting works */
- + tt_scu.gp_reg1 = 0;
-
- /* Initialize the LM1992 Sound Controller to enable the PSG sound.
- * This is misplaced here, it should be in a atasound_init(),
- ***************
- *** 104,113 ****
- }
-
-
- ! /* dummy mach_add_isr(), we don't need one */
-
- ! int atari_add_isr( unsigned long source , isrfunc isr , int pri , void *data )
-
- {
- ! return( 0 );
- }
- --- 113,187 ----
- }
-
-
- ! /*
- ! * atari_add_isr : add an interrupt service routine for a particular
- ! * machine specific interrupt source.
- ! * If the addition was successful, it returns 1, otherwise
- ! * it returns 0. It will fail if another routine is already
- ! * bound into the specified source.
- ! * Note that the "pri" argument is currently unused.
- ! */
- !
- ! int atari_add_isr (unsigned long source, isrfunc isr, int pri, void *data)
- ! {
- ! unsigned long atari_source = source & ~IRQ_MACHSPEC;
- ! isr_node_t *p;
- !
- ! if (atari_source >= NUM_ATARI_SOURCES
- ! || (atari_source >= TTMFP_SOURCE_BASE
- ! && boot_info.bi_atari.model != ATARI_TT)
- ! || (atari_source >= SCC_SOURCE_BASE
- ! /* the SCC uses only half of the vectors */
- ! && atari_source & 1))
- ! {
- ! printk ("atari_add_isr: Unknown uservector: %ld\n", atari_source);
- ! return 0;
- ! }
- !
- ! p = new_isr_node();
- ! p->isr = isr;
- ! p->pri = pri;
- ! p->data = data;
- ! p->next = NULL;
-
- ! insert_isr (&ata_lists[atari_source], p);
-
- + return 1;
- + }
- +
- + void atari_process_int (int level, struct intframe *fp)
- {
- ! ushort sr;
- ! int mask;
- !
- ! /* Lower the ipl to let interrupts with higher priority come through */
- ! asm volatile ("movew sr,%0" : "=dm" (sr));
- ! sr -= 0x100;
- ! asm volatile ("movew %0,sr" : : "dm" (sr));
- !
- ! call_isr_list (ata_lists[level], fp);
- !
- ! /* acknowledge the interrupt */
- ! mask = ~(1 << (level & 7));
- ! switch (level >> 3)
- ! {
- ! case 0:
- ! mfp.int_sv_b = mask;
- ! break;
- ! case 1:
- ! mfp.int_sv_a = mask;
- ! break;
- ! case 2:
- ! tt_mfp.int_sv_b = mask;
- ! break;
- ! case 3:
- ! tt_mfp.int_sv_a = mask;
- ! break;
- ! case 4:
- ! case 5:
- ! /* TODO: SCC interrupt acknowledge */
- ! break;
- ! default:
- ! panic ("Unknown user interrupt level %d", level);
- ! }
- }
- diff -cr --new-file linux-0.9pl1/atari/atakeyb.c linux-0.9pl2/atari/atakeyb.c
- *** linux-0.9pl1/atari/atakeyb.c Wed Jun 29 17:18:24 1994
- --- linux-0.9pl2/atari/atakeyb.c Fri Aug 5 12:46:50 1994
- ***************
- *** 90,96 ****
- /* 54-57 */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 58-5b */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 5c-5f */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- ! /* 60-63 */ K_HOLE, K_F12, K_F11, '(',
- /* 64-67 */ ')', K_PSLASH, K_PSTAR, K_P7,
- /* 68-6b */ K_P8, K_P9, K_P4, K_P5,
- /* 6c-6f */ K_P6, K_P1, K_P2, K_P3,
- --- 90,96 ----
- /* 54-57 */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 58-5b */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 5c-5f */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- ! /* 60-63 */ '<', K_F12, K_HELP, '(',
- /* 64-67 */ ')', K_PSLASH, K_PSTAR, K_P7,
- /* 68-6b */ K_P8, K_P9, K_P4, K_P5,
- /* 6c-6f */ K_P6, K_P1, K_P2, K_P3,
- ***************
- *** 123,129 ****
- /* 54-57 */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 58-5b */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 5c-5f */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- ! /* 60-63 */ K_HOLE, K_BREAK, K_SH_MEM, '(',
- /* 64-67 */ ')', K_PSLASH, K_PSTAR, K_P7,
- /* 68-6b */ K_P8, K_P9, K_P4, K_P5,
- /* 6c-6f */ K_P6, K_P1, K_P2, K_P3,
- --- 123,129 ----
- /* 54-57 */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 58-5b */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 5c-5f */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- ! /* 60-63 */ '>', K_BREAK, K_SH_MEM, '(',
- /* 64-67 */ ')', K_PSLASH, K_PSTAR, K_P7,
- /* 68-6b */ K_P8, K_P9, K_P4, K_P5,
- /* 6c-6f */ K_P6, K_P1, K_P2, K_P3,
- ***************
- *** 156,162 ****
- /* 54-57 */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 58-5b */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 5c-5f */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- ! /* 60-63 */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 64-67 */ K_HOLE, K_PSLASH, K_PSTAR, K_P7,
- /* 68-6b */ K_P8, K_P9, K_P4, K_P5,
- /* 6c-6f */ K_P6, K_P1, K_P2, K_P3,
- --- 156,162 ----
- /* 54-57 */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 58-5b */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 5c-5f */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- ! /* 60-63 */ K_HOLE, K_HOLE, K_HELP, K_HOLE,
- /* 64-67 */ K_HOLE, K_PSLASH, K_PSTAR, K_P7,
- /* 68-6b */ K_P8, K_P9, K_P4, K_P5,
- /* 6c-6f */ K_P6, K_P1, K_P2, K_P3,
- ***************
- *** 189,195 ****
- /* 54-57 */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 58-5b */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 5c-5f */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- ! /* 60-63 */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 64-67 */ K_HOLE, K_PSLASH, K_PSTAR, K_P7,
- /* 68-6b */ K_P8, K_P9, K_P4, K_P5,
- /* 6c-6f */ K_P6, K_P1, K_P2, K_P3,
- --- 189,195 ----
- /* 54-57 */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 58-5b */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 5c-5f */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- ! /* 60-63 */ K_HOLE, K_HOLE, K_HELP, K_HOLE,
- /* 64-67 */ K_HOLE, K_PSLASH, K_PSTAR, K_P7,
- /* 68-6b */ K_P8, K_P9, K_P4, K_P5,
- /* 6c-6f */ K_P6, K_P1, K_P2, K_P3,
- ***************
- *** 222,228 ****
- /* 54-57 */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 58-5b */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 5c-5f */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- ! /* 60-63 */ K_HOLE, K_HOLE, K_SH_REGS, '(',
- /* 64-67 */ ')', K_PSLASH, K_PSTAR, K_P7,
- /* 68-6b */ K_P8, K_P9, K_P4, K_P5,
- /* 6c-6f */ K_P6, K_P1, K_P2, K_P3,
- --- 222,228 ----
- /* 54-57 */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 58-5b */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 5c-5f */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- ! /* 60-63 */ '\\'&0x1f, K_HOLE, K_SH_REGS, '(',
- /* 64-67 */ ')', K_PSLASH, K_PSTAR, K_P7,
- /* 68-6b */ K_P8, K_P9, K_P4, K_P5,
- /* 6c-6f */ K_P6, K_P1, K_P2, K_P3,
- ***************
- *** 255,261 ****
- /* 54-57 */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 58-5b */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 5c-5f */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- ! /* 60-63 */ K_HOLE, K_HOLE, K_HOLE, '(',
- /* 64-67 */ ')', K_PSLASH, K_PSTAR, K_P7,
- /* 68-6b */ K_P8, K_P9, K_P4, K_P5,
- /* 6c-6f */ K_P6, K_P1, K_P2, K_P3,
- --- 255,261 ----
- /* 54-57 */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 58-5b */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 5c-5f */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- ! /* 60-63 */ K_HOLE, K_HOLE, K_HELP, '(',
- /* 64-67 */ ')', K_PSLASH, K_PSTAR, K_P7,
- /* 68-6b */ K_P8, K_P9, K_P4, K_P5,
- /* 6c-6f */ K_P6, K_P1, K_P2, K_P3,
- ***************
- *** 288,294 ****
- /* 54-57 */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 58-5b */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 5c-5f */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- ! /* 60-63 */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 64-67 */ K_HOLE, K_PSLASH, K_PSTAR, K_P7,
- /* 68-6b */ K_P8, K_P9, K_P4, K_P5,
- /* 6c-6f */ K_P6, K_P1, K_P2, K_P3,
- --- 288,294 ----
- /* 54-57 */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 58-5b */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 5c-5f */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- ! /* 60-63 */ K_HOLE, K_HOLE, K_HELP, K_HOLE,
- /* 64-67 */ K_HOLE, K_PSLASH, K_PSTAR, K_P7,
- /* 68-6b */ K_P8, K_P9, K_P4, K_P5,
- /* 6c-6f */ K_P6, K_P1, K_P2, K_P3,
- ***************
- *** 321,327 ****
- /* 54-57 */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 58-5b */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 5c-5f */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- ! /* 60-63 */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 64-67 */ K_HOLE, K_PSLASH, K_PSTAR, K_P7,
- /* 68-6b */ K_P8, K_P9, K_P4, K_P5,
- /* 6c-6f */ K_P6, K_P1, K_P2, K_P3,
- --- 321,327 ----
- /* 54-57 */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 58-5b */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 5c-5f */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- ! /* 60-63 */ K_HOLE, K_HOLE, K_HELP, K_HOLE,
- /* 64-67 */ K_HOLE, K_PSLASH, K_PSTAR, K_P7,
- /* 68-6b */ K_P8, K_P9, K_P4, K_P5,
- /* 6c-6f */ K_P6, K_P1, K_P2, K_P3,
- ***************
- *** 354,360 ****
- /* 54-57 */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 58-5b */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 5c-5f */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- ! /* 60-63 */ K_HOLE, K_CONS, K_SH_STAT, '(',
- /* 64-67 */ ')', K_PSLASH, K_PSTAR, K_ASC7,
- /* 68-6b */ K_ASC8, K_ASC9, K_ASC4, K_ASC5,
- /* 6c-6f */ K_ASC6, K_ASC1, K_ASC2, K_ASC3,
- --- 354,360 ----
- /* 54-57 */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 58-5b */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 5c-5f */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- ! /* 60-63 */ K(KT_META,'<'), K_CONS, K_SH_STAT, '(',
- /* 64-67 */ ')', K_PSLASH, K_PSTAR, K_ASC7,
- /* 68-6b */ K_ASC8, K_ASC9, K_ASC4, K_ASC5,
- /* 6c-6f */ K_ASC6, K_ASC1, K_ASC2, K_ASC3,
- ***************
- *** 387,393 ****
- /* 54-57 */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 58-5b */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 5c-5f */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- ! /* 60-63 */ K_HOLE, K_HOLE, K_HOLE, '(',
- /* 64-67 */ ')', K_PSLASH, K_PSTAR, K_P7,
- /* 68-6b */ K_P8, K_P9, K_P4, K_P5,
- /* 6c-6f */ K_P6, K_P1, K_P2, K_P3,
- --- 387,393 ----
- /* 54-57 */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 58-5b */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 5c-5f */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- ! /* 60-63 */ K(KT_META,'>'), K_HOLE, K_HELP, '(',
- /* 64-67 */ ')', K_PSLASH, K_PSTAR, K_P7,
- /* 68-6b */ K_P8, K_P9, K_P4, K_P5,
- /* 6c-6f */ K_P6, K_P1, K_P2, K_P3,
- ***************
- *** 420,426 ****
- /* 54-57 */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 58-5b */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 5c-5f */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- ! /* 60-63 */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 64-67 */ K_HOLE, K_PSLASH, K_PSTAR, K_P7,
- /* 68-6b */ K_P8, K_P9, K_P4, K_P5,
- /* 6c-6f */ K_P6, K_P1, K_P2, K_P3,
- --- 420,426 ----
- /* 54-57 */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 58-5b */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 5c-5f */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- ! /* 60-63 */ K_HOLE, K_HOLE, K_HELP, K_HOLE,
- /* 64-67 */ K_HOLE, K_PSLASH, K_PSTAR, K_P7,
- /* 68-6b */ K_P8, K_P9, K_P4, K_P5,
- /* 6c-6f */ K_P6, K_P1, K_P2, K_P3,
- ***************
- *** 453,459 ****
- /* 54-57 */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 58-5b */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 5c-5f */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- ! /* 60-63 */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 64-67 */ K_HOLE, K_PSLASH, K_PSTAR, K_P7,
- /* 68-6b */ K_P8, K_P9, K_P4, K_P5,
- /* 6c-6f */ K_P6, K_P1, K_P2, K_P3,
- --- 453,459 ----
- /* 54-57 */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 58-5b */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 5c-5f */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- ! /* 60-63 */ K_HOLE, K_HOLE, K_HELP, K_HOLE,
- /* 64-67 */ K_HOLE, K_PSLASH, K_PSTAR, K_P7,
- /* 68-6b */ K_P8, K_P9, K_P4, K_P5,
- /* 6c-6f */ K_P6, K_P1, K_P2, K_P3,
- ***************
- *** 486,492 ****
- /* 54-57 */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 58-5b */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 5c-5f */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- ! /* 60-63 */ K_HOLE, K_HOLE, K_HOLE, '(',
- /* 64-67 */ ')', K_PSLASH, K_PSTAR, K_P7,
- /* 68-6b */ K_P8, K_P9, K_P4, K_P5,
- /* 6c-6f */ K_P6, K_P1, K_P2, K_P3,
- --- 486,492 ----
- /* 54-57 */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 58-5b */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 5c-5f */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- ! /* 60-63 */ K(KT_META,'\\'&0x1f), K_HOLE, K_HELP, '(',
- /* 64-67 */ ')', K_PSLASH, K_PSTAR, K_P7,
- /* 68-6b */ K_P8, K_P9, K_P4, K_P5,
- /* 6c-6f */ K_P6, K_P1, K_P2, K_P3,
- ***************
- *** 519,525 ****
- /* 54-57 */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 58-5b */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 5c-5f */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- ! /* 60-63 */ K_HOLE, K_HOLE, K_HOLE, '(',
- /* 64-67 */ ')', K_PSLASH, K_PSTAR, K_P7,
- /* 68-6b */ K_P8, K_P9, K_P4, K_P5,
- /* 6c-6f */ K_P6, K_P1, K_P2, K_P3,
- --- 519,525 ----
- /* 54-57 */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 58-5b */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 5c-5f */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- ! /* 60-63 */ K_HOLE, K_HOLE, K_HELP, '(',
- /* 64-67 */ ')', K_PSLASH, K_PSTAR, K_P7,
- /* 68-6b */ K_P8, K_P9, K_P4, K_P5,
- /* 6c-6f */ K_P6, K_P1, K_P2, K_P3,
- ***************
- *** 552,558 ****
- /* 54-57 */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 58-5b */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 5c-5f */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- ! /* 60-63 */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 64-67 */ K_HOLE, K_PSLASH, K_PSTAR, K_P7,
- /* 68-6b */ K_P8, K_P9, K_P4, K_P5,
- /* 6c-6f */ K_P6, K_P1, K_P2, K_P3,
- --- 552,558 ----
- /* 54-57 */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 58-5b */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 5c-5f */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- ! /* 60-63 */ K_HOLE, K_HOLE, K_HELP, K_HOLE,
- /* 64-67 */ K_HOLE, K_PSLASH, K_PSTAR, K_P7,
- /* 68-6b */ K_P8, K_P9, K_P4, K_P5,
- /* 6c-6f */ K_P6, K_P1, K_P2, K_P3,
- ***************
- *** 585,591 ****
- /* 54-57 */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 58-5b */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 5c-5f */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- ! /* 60-63 */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 64-67 */ K_HOLE, K_PSLASH, K_PSTAR, K_P7,
- /* 68-6b */ K_P8, K_P9, K_P4, K_P5,
- /* 6c-6f */ K_P6, K_P1, K_P2, K_P3,
- --- 585,591 ----
- /* 54-57 */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 58-5b */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- /* 5c-5f */ K_HOLE, K_HOLE, K_HOLE, K_HOLE,
- ! /* 60-63 */ K_HOLE, K_HOLE, K_HELP, K_HOLE,
- /* 64-67 */ K_HOLE, K_PSLASH, K_PSTAR, K_P7,
- /* 68-6b */ K_P8, K_P9, K_P4, K_P5,
- /* 6c-6f */ K_P6, K_P1, K_P2, K_P3,
- ***************
- *** 819,825 ****
- }
-
- #ifdef KEYB_WRITE_INTERRUPT
- ! void ikbd_write(char *str, int len)
- {
- u_char acia_stat;
-
- --- 819,825 ----
- }
-
- #ifdef KEYB_WRITE_INTERRUPT
- ! void ikbd_write(const char *str, int len)
- {
- u_char acia_stat;
-
- ***************
- *** 830,836 ****
- {
- if (len != 1)
- {
- ! kb_stat.buf = str 1;
- kb_stat.len = len - 1;
- }
- acia.key_data = *str;
- --- 830,836 ----
- {
- if (len != 1)
- {
- ! kb_stat.buf = str + 1;
- kb_stat.len = len - 1;
- }
- acia.key_data = *str;
- ***************
- *** 846,852 ****
- * is the solution. (I made a feeble attempt in that direction but I
- * kept it simple for now.)
- */
- ! void ikbd_write(char *str, int len)
- {
- u_char acia_stat;
-
- --- 846,852 ----
- * is the solution. (I made a feeble attempt in that direction but I
- * kept it simple for now.)
- */
- ! void ikbd_write(const char *str, int len)
- {
- u_char acia_stat;
-
- ***************
- *** 867,873 ****
- /* Reset (without touching the clock) */
- void ikbd_reset(void)
- {
- ! static char cmd[2] = { 0x80, 0x01 };
-
- ikbd_write(cmd, 2);
-
- --- 867,873 ----
- /* Reset (without touching the clock) */
- void ikbd_reset(void)
- {
- ! static const char cmd[2] = { 0x80, 0x01 };
-
- ikbd_write(cmd, 2);
-
- ***************
- *** 886,892 ****
- /* Set relative mouse position reporting */
- void ikbd_mouse_rel_pos(void)
- {
- ! static char cmd[1] = { 0x08 };
-
- ikbd_write(cmd, 1);
- }
- --- 886,892 ----
- /* Set relative mouse position reporting */
- void ikbd_mouse_rel_pos(void)
- {
- ! static const char cmd[1] = { 0x08 };
-
- ikbd_write(cmd, 1);
- }
- ***************
- *** 926,932 ****
- /* Interrogate mouse position */
- void ikbd_mouse_pos_get(int *x, int *y)
- {
- ! static char cmd[1] = { 0x0D };
-
- ikbd_write(cmd, 1);
-
- --- 926,932 ----
- /* Interrogate mouse position */
- void ikbd_mouse_pos_get(int *x, int *y)
- {
- ! static const char cmd[1] = { 0x0D };
-
- ikbd_write(cmd, 1);
-
- ***************
- *** 944,950 ****
- /* Set Y=0 at bottom */
- void ikbd_mouse_y0_bot(void)
- {
- ! static char cmd[1] = { 0x0F };
-
- ikbd_write(cmd, 1);
- }
- --- 944,950 ----
- /* Set Y=0 at bottom */
- void ikbd_mouse_y0_bot(void)
- {
- ! static const char cmd[1] = { 0x0F };
-
- ikbd_write(cmd, 1);
- }
- ***************
- *** 952,958 ****
- /* Set Y=0 at top */
- void ikbd_mouse_y0_top(void)
- {
- ! static char cmd[1] = { 0x10 };
-
- ikbd_write(cmd, 1);
- }
- --- 952,958 ----
- /* Set Y=0 at top */
- void ikbd_mouse_y0_top(void)
- {
- ! static const char cmd[1] = { 0x10 };
-
- ikbd_write(cmd, 1);
- }
- ***************
- *** 960,966 ****
- /* Resume */
- void ikbd_resume(void)
- {
- ! static char cmd[1] = { 0x11 };
-
- ikbd_write(cmd, 1);
- }
- --- 960,966 ----
- /* Resume */
- void ikbd_resume(void)
- {
- ! static const char cmd[1] = { 0x11 };
-
- ikbd_write(cmd, 1);
- }
- ***************
- *** 968,974 ****
- /* Disable mouse */
- void ikbd_mouse_disable(void)
- {
- ! static char cmd[1] = { 0x12 };
-
- ikbd_write(cmd, 1);
- }
- --- 968,974 ----
- /* Disable mouse */
- void ikbd_mouse_disable(void)
- {
- ! static const char cmd[1] = { 0x12 };
-
- ikbd_write(cmd, 1);
- }
- ***************
- *** 976,982 ****
- /* Pause output */
- void ikbd_pause(void)
- {
- ! static char cmd[1] = { 0x13 };
-
- ikbd_write(cmd, 1);
- }
- --- 976,982 ----
- /* Pause output */
- void ikbd_pause(void)
- {
- ! static const char cmd[1] = { 0x13 };
-
- ikbd_write(cmd, 1);
- }
- ***************
- *** 984,990 ****
- /* Set joystick event reporting */
- void ikbd_joystick_event_on(void)
- {
- ! static char cmd[1] = { 0x14 };
-
- ikbd_write(cmd, 1);
- }
- --- 984,990 ----
- /* Set joystick event reporting */
- void ikbd_joystick_event_on(void)
- {
- ! static const char cmd[1] = { 0x14 };
-
- ikbd_write(cmd, 1);
- }
- ***************
- *** 992,998 ****
- /* Set joystick interrogation mode */
- void ikbd_joystick_event_off(void)
- {
- ! static char cmd[1] = { 0x15 };
-
- ikbd_write(cmd, 1);
- }
- --- 992,998 ----
- /* Set joystick interrogation mode */
- void ikbd_joystick_event_off(void)
- {
- ! static const char cmd[1] = { 0x15 };
-
- ikbd_write(cmd, 1);
- }
- ***************
- *** 1000,1006 ****
- /* Joystick interrogation */
- void ikbd_joystick_get_state(void)
- {
- ! static char cmd[1] = { 0x16 };
-
- ikbd_write(cmd, 1);
- }
- --- 1000,1006 ----
- /* Joystick interrogation */
- void ikbd_joystick_get_state(void)
- {
- ! static const char cmd[1] = { 0x16 };
-
- ikbd_write(cmd, 1);
- }
- ***************
- *** 1010,1016 ****
- /* Set joystick monitoring */
- void ikbd_joystick_monitor(int rate)
- {
- ! static char cmd[2] = { 0x17, rate };
-
- ikbd_write(cmd, 2);
-
- --- 1010,1016 ----
- /* Set joystick monitoring */
- void ikbd_joystick_monitor(int rate)
- {
- ! static const char cmd[2] = { 0x17, rate };
-
- ikbd_write(cmd, 2);
-
- ***************
- *** 1023,1029 ****
- /* Disable joysticks */
- void ikbd_joystick_disable(void)
- {
- ! static char cmd[1] = { 0x1A };
-
- ikbd_write(cmd, 1);
- }
- --- 1023,1029 ----
- /* Disable joysticks */
- void ikbd_joystick_disable(void)
- {
- ! static const char cmd[1] = { 0x1A };
-
- ikbd_write(cmd, 1);
- }
- ***************
- *** 1039,1045 ****
- /* Interrogate time-of-day clock */
- void ikbd_clock_get(int *year, int *month, int *day, int *hour, int *minute, int second)
- {
- ! static char cmd[1] = { 0x1C };
-
- ikbd_write(cmd, 1);
- }
- --- 1039,1045 ----
- /* Interrogate time-of-day clock */
- void ikbd_clock_get(int *year, int *month, int *day, int *hour, int *minute, int second)
- {
- ! static const char cmd[1] = { 0x1C };
-
- ikbd_write(cmd, 1);
- }
- diff -cr --new-file linux-0.9pl1/atari/config.c linux-0.9pl2/atari/config.c
- *** linux-0.9pl1/atari/config.c Wed Jun 29 16:02:22 1994
- --- linux-0.9pl2/atari/config.c Fri Aug 5 12:46:51 1994
- ***************
- *** 35,79 ****
- #include <asm/system.h>
-
-
- ! extern long time_adj; /* from kernel/sched.c */
-
-
- ! void atari_sched_init (isrfunc timer_routine)
- {
- ! /* set Timer A data Register */
- ! mfp.tim_dt_a=INT_TICKS;
-
- ! /* install interrupt service routine for MFP Timer A */
- ! add_isr (IRQ_MFP_TIMA, timer_routine, 0, NULL);
- ! /* start timer A, div = 1:100 */
- ! mfp.tim_ct_a = 0x06;
- ! /* enable timer A Interrupt */
- ! mfp.int_en_a |= 0x20;
- !
- ! /* The excact frequency of our timer is 2.4576 MHz / 100 / 246 =
- ! * 99.90243902 Hz. This gives a difference of 9.76954 us to real time
- ! * per clock tick. time_adj is in us scaled by 2^24, thus it should
- ! * be 9.76954 * 2^24 = 163905683
- ! */
- ! time_adj = 163905683;
- }
-
-
- unsigned long atari_gettimeoffset (void)
- {
- ! unsigned long ticks, flags;
-
- ! save_flags(flags);
- ! cli();
-
- ! ticks = (unsigned long)mfp.tim_dt_a;
- ! restore_flags(flags);
- !
- ! ticks = (INT_TICKS-1) - ticks;
- ! ticks = ticks * 10000L / INT_TICKS;
- !
- ! return ticks;
-
- }
-
-
- --- 35,93 ----
- #include <asm/system.h>
-
-
- ! /* ++andreas: timer interrupt fixed to have perfect 100 Hz */
-
- + static int timer_c_high;
-
- ! /* Intermediate timer routine to allow for INT_TICKS to be bigger
- ! than 256. */
- ! static void atari_timer_routine (struct intframe *fp, void *data)
- {
- ! if (--timer_c_high < 0)
- ! {
- ! isrfunc timer_routine = (isrfunc) data;
- ! timer_c_high = 1;
- ! timer_routine (fp, NULL);
- ! }
- ! }
-
- ! void atari_sched_init (isrfunc timer_routine)
- ! {
- ! /* set Timer C data Register */
- ! mfp.tim_dt_c = INT_TICKS / 2;
- ! timer_c_high = 0;
- !
- ! /* install interrupt service routine for MFP Timer C */
- ! add_isr (IRQ_MFP_TIMC, atari_timer_routine, 0, timer_routine);
- ! /* start timer C, div = 1:64 */
- ! mfp.tim_ct_cd = (mfp.tim_ct_cd & 15) | 0x50;
- ! /* enable timer C Interrupt */
- ! mfp.int_en_b |= 0x20;
- }
-
- + /* ++andreas: gettimeoffset fixed to check for pending interrupt */
-
- + #define TICK_SIZE 5000
- +
- + /* This is always executed with interrupts disabled. */
- unsigned long atari_gettimeoffset (void)
- {
- ! unsigned long ticks, offset = 0;
-
- ! /* read MFP timer C current value */
- ! ticks = mfp.tim_dt_c;
- ! /* The probability of underflow is less than 2% */
- ! if (ticks > INT_TICKS / 2 - INT_TICKS / 100)
- ! /* Check for pending timer interrupt */
- ! if (mfp.int_pn_b & (1 << 5))
- ! offset = TICK_SIZE;
- ! if (timer_c_high)
- ! ticks += INT_TICKS / 2;
-
- ! ticks = INT_TICKS - ticks;
- ! ticks = ticks * 10000L / INT_TICKS;
-
- + return ticks + offset;
- }
-
-
- ***************
- *** 113,119 ****
-
- /* Adjust values (let the setup valid for TOS) */
- time->mon--;
- ! time->year += 70;
-
- ctrl = RTC_READ(RTC_CONTROL);
-
- --- 127,133 ----
-
- /* Adjust values (let the setup valid for TOS) */
- time->mon--;
- ! time->year += 68;
-
- ctrl = RTC_READ(RTC_CONTROL);
-
- diff -cr --new-file linux-0.9pl1/atari/stram.c linux-0.9pl2/atari/stram.c
- *** linux-0.9pl1/atari/stram.c Wed Dec 31 19:00:00 1969
- --- linux-0.9pl2/atari/stram.c Fri Aug 5 12:46:52 1994
- ***************
- *** 0 ****
- --- 1,141 ----
- + #include <linux/types.h>
- + #include <linux/kernel.h>
- + #include <linux/bootinfo.h>
- + #include <linux/atarihw.h>
- +
- + struct stram_desc
- + {
- + unsigned first:1;
- + unsigned last:1;
- + unsigned alloced:1;
- + unsigned length:24;
- + };
- +
- + #define DP(ptr) ((struct stram_desc *) (ptr))
- +
- + static unsigned long stramsize;
- + static unsigned long stramaddr;
- +
- + void
- + atari_stram_init (void)
- + {
- + struct stram_desc *dp;
- + stramaddr = boot_info.bi_atari.stram_start;
- + stramsize = boot_info.bi_atari.stram_size;
- +
- + /* initialize start boundary */
- + dp = DP (stramaddr);
- + dp->first = 1;
- + dp->alloced = 0;
- + dp->length = stramsize - 2 * sizeof (*dp);
- +
- + /* initialize end boundary */
- + dp = DP (stramaddr + stramsize) - 1;
- + dp->last = 1;
- + dp->alloced = 0;
- + dp->length = stramsize - 2 * sizeof (*dp);
- +
- + #ifdef DEBUG
- + printk ("stram end boundary is %p, length is %d\n", dp,
- + dp->length);
- + #endif
- + }
- +
- + void *
- + atari_stram_alloc (long size)
- + {
- + /* last chunk */
- + struct stram_desc *dp;
- + void *ptr;
- +
- + /* round off */
- + size = (size + 3) & ~3;
- +
- + #ifdef DEBUG
- + printk ("stram_alloc: allocate %ld bytes\n", size);
- + #endif
- +
- + /*
- + * get pointer to descriptor for last chunk by
- + * going backwards from end chunk
- + */
- + dp = DP (stramaddr + stramsize) - 1;
- + dp = DP ((unsigned long) dp - dp->length) - 1;
- +
- + while ((dp->alloced || dp->length < size) && !dp->first)
- + dp = DP ((unsigned long) dp - dp[-1].length) - 2;
- +
- + if (dp->alloced || dp->length < size)
- + {
- + printk ("no stram available for %ld allocation\n", size);
- + return NULL;
- + }
- +
- + if (dp->length < size + 2 * sizeof (*dp))
- + {
- + /* length too small to split; allocate the whole thing */
- + dp->alloced = 1;
- + ptr = (void *) (dp + 1);
- + dp = DP ((unsigned long) ptr + dp->length);
- + dp->alloced = 1;
- + #ifdef DEBUG
- + printk ("stram_alloc: no split\n");
- + #endif
- + }
- + else
- + {
- + /* split the extent; use the end part */
- + long newsize = dp->length - (2 * sizeof (*dp) + size);
- +
- + #ifdef DEBUG
- + printk ("stram_alloc: splitting %d to %ld\n", dp->length,
- + newsize);
- + #endif
- + dp->length = newsize;
- + dp = DP ((unsigned long) (dp + 1) + newsize);
- + dp->first = dp->last = 0;
- + dp->alloced = 0;
- + dp->length = newsize;
- + dp++;
- + dp->first = dp->last = 0;
- + dp->alloced = 1;
- + dp->length = size;
- + ptr = (void *) (dp + 1);
- + dp = DP ((unsigned long) ptr + size);
- + dp->alloced = 1;
- + dp->length = size;
- + }
- +
- + #ifdef DEBUG
- + printk ("stram_alloc: returning %p\n", ptr);
- + #endif
- + return ptr;
- + }
- +
- + void
- + atari_stram_free (void *ptr)
- + {
- + struct stram_desc *sdp = DP (ptr) - 1, *dp2;
- + struct stram_desc *edp = DP ((unsigned long) ptr + sdp->length);
- +
- + /* deallocate the chunk */
- + sdp->alloced = edp->alloced = 0;
- +
- + /* check if we should merge with the previous chunk */
- + if (!sdp->first && !sdp[-1].alloced)
- + {
- + dp2 = DP ((unsigned long) sdp - sdp[-1].length) - 2;
- + dp2->length += sdp->length + 2 * sizeof (*sdp);
- + edp->length = dp2->length;
- + sdp = dp2;
- + }
- +
- + /* check if we should merge with the following chunk */
- + if (!edp->last && !edp[1].alloced)
- + {
- + dp2 = DP ((unsigned long) edp + edp[1].length) + 2;
- + dp2->length += edp->length + 2 * sizeof (*sdp);
- + sdp->length = dp2->length;
- + edp = dp2;
- + }
- + }
- diff -cr --new-file linux-0.9pl1/config.in linux-0.9pl2/config.in
- *** linux-0.9pl1/config.in Tue Jul 26 22:15:18 1994
- --- linux-0.9pl2/config.in Fri Aug 5 12:51:33 1994
- ***************
- *** 53,60 ****
- bool 'GVP Series II WD33C93A support' CONFIG_GVP11_SCSI y
- fi
- if [ "$CONFIG_ATARI" = "y" ]
- ! bool 'Atari TT native SCSI support' CONFIG_ATARI_TT_SCSI y
- ! bool 'Atari Falcon native SCSI support' CONFIG_ATARI_FALCON_SCSI y
- fi
- fi
- *
- --- 53,59 ----
- bool 'GVP Series II WD33C93A support' CONFIG_GVP11_SCSI y
- fi
- if [ "$CONFIG_ATARI" = "y" ]
- ! bool 'Atari native SCSI support' CONFIG_ATARI_SCSI y
- fi
- fi
- *
- diff -cr --new-file linux-0.9pl1/drivers/block/ataflop.c linux-0.9pl2/drivers/block/ataflop.c
- *** linux-0.9pl1/drivers/block/ataflop.c Wed Jun 29 16:25:43 1994
- --- linux-0.9pl2/drivers/block/ataflop.c Fri Aug 5 12:46:53 1994
- ***************
- *** 82,88 ****
-
- /* track buffer */
- static int savedtrack = -1;
- ! static unsigned char trackdata[512];
-
- /*
- * These are global variables, as that's the easiest way to give
- --- 82,88 ----
-
- /* track buffer */
- static int savedtrack = -1;
- ! unsigned char *trackdata; /* allocated by atari_stram_alloc */
-
- /*
- * These are global variables, as that's the easiest way to give
- ***************
- *** 140,171 ****
- static int on_attempts;
- #endif
-
- ! static void wait_func(void)
- ! {
- ! int i;
- ! for(i=0;i<30;i++)
- ! i=i;
- ! }
- !
- ! static void fd_select (int drive,unsigned short tr)
- {
- - int oldtr;
- unsigned long flags;
- unsigned char tmp;
-
- if (drive == selected)
- return;
- - oldtr=tr/2;
- selected = drive;
-
- save_flags(flags);
- cli();
-
- ! if(oldtr*2==tr)
- {
- sound_ym.rd_data_reg_sel=14; /* Select PSG Port A */
- tmp = sound_ym.rd_data_reg_sel;
- ! sound_ym.wd_data = tmp & ~2; /* Select Side 0 and Drive A */
- }
- else
- {
- --- 140,162 ----
- static int on_attempts;
- #endif
-
- ! static void fd_select (int drive, int side)
- {
- unsigned long flags;
- unsigned char tmp;
-
- if (drive == selected)
- return;
- selected = drive;
-
- save_flags(flags);
- cli();
-
- ! if (side == 0)
- {
- sound_ym.rd_data_reg_sel=14; /* Select PSG Port A */
- tmp = sound_ym.rd_data_reg_sel;
- ! sound_ym.wd_data = (tmp & ~2) | 1; /* Select Side 0 and Drive A */
- }
- else
- {
- ***************
- *** 233,243 ****
- dma_wd.dma_mode_status=FDCSELREG_DTA;
- nop();
- dma_wd.fdc_acces_seccount=track;
- ! wait_func();
- dma_wd.dma_mode_status=FDCSELREG_STP;
- nop();
- dma_wd.fdc_acces_seccount=FDCCMD_SEEK | FDCCMDADD_V ;
- ! wait_func();
- fd_nobusy();
-
- return 1;
- --- 224,234 ----
- dma_wd.dma_mode_status=FDCSELREG_DTA;
- nop();
- dma_wd.fdc_acces_seccount=track;
- ! udelay (1);
- dma_wd.dma_mode_status=FDCSELREG_STP;
- nop();
- dma_wd.fdc_acces_seccount=FDCCMD_SEEK | FDCCMDADD_V ;
- ! udelay (1);
- fd_nobusy();
-
- return 1;
- ***************
- *** 262,277 ****
- static void atari_write(int dr, unsigned short tr, unsigned short sec)
- {
- unsigned long phys_secbuf,flags;
- - int i;
-
- sec=sec+1;
-
- ! phys_secbuf=VTOP((unsigned long)trackdata); /* DMA knows PhysAdr only ! */
-
- save_flags(flags);
- cli();
-
- ! fd_select(dr,tr);
-
- tr=tr/2;
-
- --- 253,267 ----
- static void atari_write(int dr, unsigned short tr, unsigned short sec)
- {
- unsigned long phys_secbuf,flags;
-
- sec=sec+1;
-
- ! phys_secbuf = (unsigned long) trackdata;
-
- save_flags(flags);
- cli();
-
- ! fd_select (dr, tr & 1);
-
- tr=tr/2;
-
- ***************
- *** 294,323 ****
-
- /* Transmit only 1 Sector */
- dma_wd.fdc_acces_seccount=0x01;
- ! wait_func();
-
-
- dma_wd.dma_mode_status=FDCSELREG_SEC | 0x100 ;
- nop();
- dma_wd.fdc_acces_seccount=sec;
- ! wait_func();
-
- /* Start Write */
- dma_wd.dma_mode_status=FDCSELREG_STP | 0x100 ;
- nop();
- dma_wd.fdc_acces_seccount=FDCCMD_WRSEC ;
- ! wait_func();;
-
- fd_nobusy(); /* Wait for IRQ 5 */
-
- restore_flags(flags);
-
- fd_deselect(dr);
- !
- ! for(i=0;i<20000;i++)
- ! {
- ! i=i;
- ! }
- }
-
- /*==========================================================================
- --- 284,310 ----
-
- /* Transmit only 1 Sector */
- dma_wd.fdc_acces_seccount=0x01;
- ! udelay (1);
-
-
- dma_wd.dma_mode_status=FDCSELREG_SEC | 0x100 ;
- nop();
- dma_wd.fdc_acces_seccount=sec;
- ! udelay (1);
-
- /* Start Write */
- dma_wd.dma_mode_status=FDCSELREG_STP | 0x100 ;
- nop();
- dma_wd.fdc_acces_seccount=FDCCMD_WRSEC ;
- ! udelay (1);
-
- fd_nobusy(); /* Wait for IRQ 5 */
-
- restore_flags(flags);
-
- fd_deselect(dr);
- !
- ! udelay (10);
- }
-
- /*==========================================================================
- ***************
- *** 327,340 ****
- {
- unsigned long phys_secbuf,flags;
-
- ! phys_secbuf=VTOP((unsigned long)trackdata);
-
- sec=sec+1;
-
- save_flags(flags);
- cli();
-
- ! fd_select(dr,tr);
-
- tr=tr/2;
-
- --- 314,327 ----
- {
- unsigned long phys_secbuf,flags;
-
- ! phys_secbuf = (unsigned long) trackdata;
-
- sec=sec+1;
-
- save_flags(flags);
- cli();
-
- ! fd_select (dr, tr & 1);
-
- tr=tr/2;
-
- ***************
- *** 356,373 ****
- dma_wd.dma_mode_status=0x90;
- /* Transmit only 1 Sector */
- dma_wd.fdc_acces_seccount=0x01;
- ! wait_func();
-
- dma_wd.dma_mode_status=FDCSELREG_SEC;
- nop();
- dma_wd.fdc_acces_seccount=sec;
- ! wait_func();
-
- /* Start READ */
- dma_wd.dma_mode_status=FDCSELREG_STP;
- nop();
- dma_wd.fdc_acces_seccount=FDCCMD_RDSEC ;
- ! wait_func();
-
- fd_nobusy(); /* Wait for IRQ 5 */
-
- --- 343,360 ----
- dma_wd.dma_mode_status=0x90;
- /* Transmit only 1 Sector */
- dma_wd.fdc_acces_seccount=0x01;
- ! udelay (1);
-
- dma_wd.dma_mode_status=FDCSELREG_SEC;
- nop();
- dma_wd.fdc_acces_seccount=sec;
- ! udelay (1);
-
- /* Start READ */
- dma_wd.dma_mode_status=FDCSELREG_STP;
- nop();
- dma_wd.fdc_acces_seccount=FDCCMD_RDSEC ;
- ! udelay (1);
-
- fd_nobusy(); /* Wait for IRQ 5 */
-
- ***************
- *** 537,544 ****
- --- 524,533 ----
-
- #ifdef CONFIG_FLOPPY_DD_ONLY
- unit[drive].type = &drive_types[1]; /* DD */
- + dma_wd.fdc_speed = 0;
- #else
- unit[drive].type = &drive_types[0]; /* HD */
- + dma_wd.fdc_speed = 3;
- #endif
-
- unit[drive].dtype = &data_types[0]; /* only one type */
- ***************
- *** 634,639 ****
- --- 623,631 ----
- }
- /* initialize variables */
- selected = -1;
- +
- + /* memory returned by atari_stram_alloc is identity mapped */
- + trackdata = atari_stram_alloc (512);
-
- for (i = 0; i < FD_MAX_UNITS; i++) {
- unit[i].track = -1;
- diff -cr --new-file linux-0.9pl1/drivers/char/Makefile linux-0.9pl2/drivers/char/Makefile
- *** linux-0.9pl1/drivers/char/Makefile Wed Jun 29 17:07:26 1994
- --- linux-0.9pl2/drivers/char/Makefile Sat Aug 6 20:04:11 1994
- ***************
- *** 1,4 ****
- ! # Makefile for 680x0 Linux chr_drv source directory
- #
- # Copyright 1993 by Hamish Macdonald
- #
- --- 1,4 ----
- ! # Makefile for 680x0 Linux drivers/char source directory
- #
- # Copyright 1993 by Hamish Macdonald
- #
- ***************
- *** 9,16 ****
- include ../../.config
- include ../../MakeVars
-
- ! OBJS = tty_io.o console.o keyboard.o tty_ioctl.o pty.o vt.o mem.o
- ! SRCS = tty_io.c console.c keyboard.c tty_ioctl.c pty.c vt.c mem.c
-
- ifdef CONFIG_AMIGAMOUSE
- M = y
- --- 9,16 ----
- include ../../.config
- include ../../MakeVars
-
- ! OBJS = tty_io.o console.o keyboard.o tty_ioctl.o pty.o vt.o mem.o serial.o
- ! SRCS = tty_io.c console.c keyboard.c tty_ioctl.c pty.c vt.c mem.c serial.c
-
- ifdef CONFIG_AMIGAMOUSE
- M = y
- ***************
- *** 68,78 ****
- endif
-
- ifdef CONFIG_ATARI
- ! OBJS := $(OBJS) atari_serial.o atari_MFPser.o atari_SCC.o
- ! SRCS := $(SRCS) atari_serial.c atari_MFPser.c atari_SCC.c
- ! else
- ! OBJS := $(OBJS) serial.o
- ! SRCS := $(SRCS) serial.c
- endif
-
- all: char.a
- --- 68,80 ----
- endif
-
- ifdef CONFIG_ATARI
- ! OBJS := $(OBJS) atari_MFPser.o atari_SCC.o
- ! SRCS := $(SRCS) atari_MFPser.c atari_SCC.c
- ! endif
- !
- ! ifdef CONFIG_AMIGA
- ! OBJS := $(OBJS) amiga_ser.o
- ! SRCS := $(SRCS) amiga_ser.c
- endif
-
- all: char.a
- diff -cr --new-file linux-0.9pl1/drivers/char/amiga_ser.c linux-0.9pl2/drivers/char/amiga_ser.c
- *** linux-0.9pl1/drivers/char/amiga_ser.c Wed Dec 31 19:00:00 1969
- --- linux-0.9pl2/drivers/char/amiga_ser.c Mon Aug 8 20:32:38 1994
- ***************
- *** 0 ****
- --- 1,364 ----
- +
- +
- + /*
- + * drivers/char/amiga_ser.c: Amiga built-in serial port driver.
- + *
- + * Copyright 1994 Roman Hodek, 1994 Hamish Macdonald
- + * Based on the Atari MFP driver by Roman Hodek
- + *
- + * This file is subject to the terms and conditions of the GNU General Public
- + * License. See the file README.legal in the main directory of this archive
- + * for more details.
- + *
- + */
- +
- +
- + /*
- + * This file implements the driver for the Amiga built-in serial port.
- + */
- +
- + #include <linux/types.h>
- + #include <linux/sched.h>
- + #include <linux/interrupt.h>
- + #include <linux/errno.h>
- + #include <linux/tty.h>
- + #include <linux/termios.h>
- + #include <linux/bootinfo.h>
- + #include <linux/amigahw.h>
- + #include <linux/amigaints.h>
- +
- + #include "serial.h"
- +
- + /* some serial hardware definitions */
- + #define SDR_OVRUN (1<<15)
- + #define SDR_TBE (1<<13)
- + #define SDR_TSRE (1<<12)
- +
- + #define AC_SETCLR (1<<15)
- + #define AC_UARTBRK (1<<11)
- +
- + #define SER_DTR (1<<7)
- + #define SER_RTS (1<<6)
- + #define SER_DCD (1<<5)
- + #define SER_CTS (1<<4)
- + #define SER_DSR (1<<3)
- +
- + /***************************** Prototypes *****************************/
- +
- + static void ser_rx_int( struct intframe *fp, struct async_struct *info );
- + static void ser_tx_int( struct intframe *fp, struct async_struct *info );
- + static void ser_vbl_int( struct intframe *fp, struct async_struct *info );
- + static void ser_init( struct async_struct *info );
- + static void ser_deinit( struct async_struct *info, int leave_dtr );
- + static int ser_check_custom_divisor( struct async_struct *info, int divisor );
- + static void ser_change_speed( struct async_struct *info );
- + static void ser_restart( struct async_struct *info );
- + static void ser_throttle( struct async_struct *info, int status );
- + static void ser_set_break( struct async_struct *info, int break_flag );
- + static void ser_get_serial_info( struct async_struct *info,
- + struct serial_struct *retinfo );
- + static unsigned int ser_get_modem_info( struct async_struct *info );
- + static int ser_set_modem_info( struct async_struct *info, int new_dtr,
- + int new_rts );
- +
- + /************************* End of Prototypes **************************/
- +
- +
- +
- + /* SERIALSWITCH structure for the Amiga serial port
- + */
- +
- + static SERIALSWITCH amiga_ser_switch = {
- + ser_init, ser_deinit, NULL,
- + ser_check_custom_divisor, ser_change_speed,
- + ser_restart, ser_throttle, ser_set_break,
- + ser_get_serial_info, ser_get_modem_info,
- + ser_set_modem_info, NULL
- + };
- +
- + /* Divisors for standard speeds (NTSC and PAL) */
- + static int baud_table[2][15] = {
- + /* NTSC */
- + {
- + /* B0 */ 0,
- + /* B50 */ 71589,
- + /* B75 */ 47726,
- + /* B110 */ 32540,
- + /* B134 */ 26712,
- + /* B150 */ 23862,
- + /* B200 */ 17896,
- + /* B300 */ 11930,
- + /* B600 */ 5964,
- + /* B1200 */ 2892,
- + /* B1800 */ 1987,
- + /* B2400 */ 1490,
- + /* B4800 */ 744,
- + /* B9600 */ 371,
- + /* B19200 */ 185
- + },
- + /* PAL */
- + {
- + /* B0 */ 0,
- + /* B50 */ 70936,
- + /* B75 */ 47290,
- + /* B110 */ 32243,
- + /* B134 */ 26468,
- + /* B150 */ 23644,
- + /* B200 */ 17733,
- + /* B300 */ 11821,
- + /* B600 */ 5910,
- + /* B1200 */ 2954,
- + /* B1800 */ 1969,
- + /* B2400 */ 1476,
- + /* B4800 */ 737,
- + /* B9600 */ 368,
- + /* B19200 */ 183
- + }
- + };
- +
- + static __inline__ void ser_DTRoff(void)
- + {
- + ciab.pra |= SER_DTR; /* active low */
- + }
- +
- + static __inline__ void ser_DTRon(void)
- + {
- + ciab.pra &= ~SER_DTR; /* active low */
- + }
- +
- + static __inline__ void ser_RTSoff(void)
- + {
- + ciab.pra |= SER_RTS; /* active low */
- + }
- +
- + static __inline__ void ser_RTSon(void)
- + {
- + ciab.pra &= ~SER_RTS; /* active low */
- + }
- +
- + void amiga_serinit( struct async_struct *info )
- + {
- + unsigned long flags;
- +
- + save_flags (flags);
- + cli();
- +
- + /* set ISRs, and then disable the rx interrupts */
- + add_isr( IRQ_AMIGA_TBE, (isrfunc)ser_tx_int, 0, info);
- + add_isr( IRQ_AMIGA_RBF, (isrfunc)ser_rx_int, 0, info);
- + add_isr( IRQ_AMIGA_VERTB, (isrfunc)ser_vbl_int, 0, info );
- +
- + custom.intena = IF_RBF;
- + /* clear any pending interrupts */
- + custom.intreq = IF_RBF | IF_TBE;
- + restore_flags (flags);
- +
- + /*
- + * set the appropriate directions for the modem control flags,
- + * and clear RTS and DTR
- + */
- + ciab.ddra |= (SER_DTR | SER_RTS); /* outputs */
- + ciab.ddra &= ~(SER_DCD | SER_CTS | SER_DSR); /* inputs */
- + ciab.pra |= (SER_DTR | SER_RTS); /* active low */
- +
- + info->type = SER_AMIGA;
- + info->base = &custom.serdatr; /* dummy value */
- + info->RI.addr = 0; /* NO RI */
- + info->RI.bitno = 0;
- + info->RI.active_state = 0;
- + info->sw = &amiga_ser_switch;
- + }
- +
- +
- + static void ser_rx_int( struct intframe *fp, struct async_struct *info )
- + {
- + int ch, err = 0;
- +
- + ch = custom.serdatr;
- + if (ch & SDR_OVRUN)
- + err = TTY_OVERRUN;
- +
- + ch &= 0x7f;
- +
- + rs_put_char_to_queue( info, ch, err );
- + rs_rx_throttle_if_needed( info );
- + }
- +
- +
- + static void ser_tx_int( struct intframe *fp, struct async_struct *info )
- + {
- + int ch;
- +
- + if (custom.serdatr & SDR_TBE) {
- + if ((ch = rs_get_char_from_queue( info )) < 0) return;
- + custom.serdat = ch | 0x100;
- + rs_tx_wakeup_if_needed( info );
- + } else
- + printk ("ser_tx_int without TBE!\n");
- + }
- +
- +
- + /* This variable holds the current state of the DCD/CTS bits */
- + static unsigned char current_ctl_bits;
- +
- + static void ser_vbl_int( struct intframe *fp, struct async_struct *info )
- + {
- + unsigned char bits;
- +
- + if (!(info->flags & ASYNC_INITIALIZED))
- + return;
- +
- + bits = ciaa.pra & (SER_DCD | SER_CTS);
- +
- + if (bits ^ current_ctl_bits) {
- +
- + if ((bits ^ current_ctl_bits) & SER_DCD)
- + rs_dcd_changed( info, !(bits & SER_DCD)); /* active low */
- +
- + if ((bits ^ current_ctl_bits) & SER_CTS)
- + rs_cts_changed( info, !(bits & SER_CTS)); /* active low */
- + }
- +
- + current_ctl_bits = bits;
- + }
- +
- + static void ser_init( struct async_struct *info )
- + {
- + /* enable Rx interrupts */
- + custom.intena = IF_SETCLR | IF_RBF;
- +
- + /* turn on DTR and RTS */
- + ser_DTRon();
- + ser_RTSon();
- +
- + /* remember current state of the DCD and CTS bits */
- + current_ctl_bits = ciaa.pra & (SER_DCD | SER_CTS);
- + }
- +
- +
- + static void ser_deinit( struct async_struct *info, int leave_dtr )
- + {
- + /* disable Rx interrupts */
- + custom.intena = IF_RBF;
- +
- + /* wait for last byte to be completely shifted out */
- + while( !(custom.serdatr & SDR_TSRE) )
- + ;
- +
- + /* drop RTS and DTR if required */
- + ser_RTSoff();
- + if (!leave_dtr)
- + ser_DTRoff();
- + }
- +
- +
- + static int ser_check_custom_divisor( struct async_struct *info, int divisor )
- + {
- + /* allow any divisor */
- + return 1;
- + }
- +
- +
- + static void ser_change_speed( struct async_struct *info )
- +
- + {
- + unsigned cflag, baud, chsize, stopb, parity, aflags;
- + unsigned div = 0;
- +
- + if (!info->tty || !info->tty->termios) return;
- +
- + cflag = info->tty->termios->c_cflag;
- + baud = cflag & CBAUD;
- + chsize = cflag & CSIZE;
- + stopb = cflag & CSTOPB;
- + parity = cflag & (PARENB | PARODD);
- + aflags = info->flags & ASYNC_SPD_MASK;
- +
- + if (baud == 15 && aflags == ASYNC_SPD_CUST)
- + div = info->custom_divisor;
- + else {
- + /* Maximum speed is 19200 :-( */
- + if (baud > 14) baud = 14;
- + if (boot_info.bi_amiga.eclock == NTSC_ECLOCK)
- + div = baud_table[0][baud];
- + else
- + div = baud_table[1][baud];
- + }
- +
- + if (!div) {
- + /* speed == 0 -> drop DTR */
- + ser_DTRoff();
- + return;
- + }
- +
- + /* setup the serial port period register */
- + custom.serper = div;
- + }
- +
- +
- + static void ser_restart( struct async_struct *info )
- + {
- + int ch;
- +
- + if ((custom.serdatr & SDR_TBE) && !(custom.intreqr & IF_TBE))
- + if ((ch = rs_get_char_from_queue (info)) >= 0)
- + custom.serdat = ch | 0x100;
- + }
- +
- +
- + static void ser_throttle( struct async_struct *info, int status )
- + {
- + if (status == TTY_THROTTLE_RQ_FULL)
- + ser_RTSoff();
- + else if (status == TTY_THROTTLE_RQ_AVAIL)
- + ser_RTSon();
- + }
- +
- +
- + static void ser_set_break( struct async_struct *info, int break_flag )
- + {
- + if (break_flag)
- + custom.adkcon = AC_SETCLR | AC_UARTBRK;
- + else
- + custom.adkcon = AC_UARTBRK;
- + }
- +
- +
- + static void ser_get_serial_info( struct async_struct *info,
- + struct serial_struct *retinfo )
- + {
- + retinfo->baud_base = 0;
- + retinfo->custom_divisor = info->custom_divisor;
- + }
- +
- +
- + static unsigned int ser_get_modem_info( struct async_struct *info )
- + {
- + unsigned int minfo = ciab.pra;
- +
- + return(
- + ((minfo & SER_DTR) ? 0 : TIOCM_DTR) |
- + ((minfo & SER_RTS) ? 0 : TIOCM_RTS) |
- + ((minfo & SER_DCD) ? 0 : TIOCM_CAR) |
- + ((minfo & SER_CTS) ? 0 : TIOCM_CTS) |
- + ((minfo & SER_DSR) ? 0 : TIOCM_DSR) |
- + /* TICM_RNG */ 0
- + );
- + }
- +
- +
- + static int ser_set_modem_info( struct async_struct *info,
- + int new_dtr, int new_rts )
- + {
- + if (new_dtr == 0)
- + ser_DTRoff();
- + else if (new_dtr == 1)
- + ser_DTRon();
- +
- + if (new_rts == 0)
- + ser_RTSoff();
- + else if (new_rts == 1)
- + ser_RTSon();
- +
- + return( 0 );
- + }
- diff -cr --new-file linux-0.9pl1/drivers/char/atari_MFPser.c linux-0.9pl2/drivers/char/atari_MFPser.c
- *** linux-0.9pl1/drivers/char/atari_MFPser.c Sun Jun 26 19:23:54 1994
- --- linux-0.9pl2/drivers/char/atari_MFPser.c Sun Aug 7 11:52:59 1994
- ***************
- *** 44,50 ****
- #include <linux/atarihw.h>
- #include <linux/atariints.h>
-
- ! #include "atari_serial.h"
- #include "atari_MFPser.h"
-
-
- --- 44,50 ----
- #include <linux/atarihw.h>
- #include <linux/atariints.h>
-
- ! #include "serial.h"
- #include "atari_MFPser.h"
-
-
- ***************
- *** 65,71 ****
- static int MFPser_check_custom_divisor( struct async_struct *info, int
- divisor );
- static void MFPser_change_speed( struct async_struct *info );
- ! static void MFPser_restart( struct async_struct *info, int ch );
- static void MFPctrl_throttle( struct async_struct *info, int status );
- static void MFPbare_throttle( struct async_struct *info, int status );
- static void MFPser_set_break( struct async_struct *info, int break_flag );
- --- 65,71 ----
- static int MFPser_check_custom_divisor( struct async_struct *info, int
- divisor );
- static void MFPser_change_speed( struct async_struct *info );
- ! static void MFPser_restart( struct async_struct *info );
- static void MFPctrl_throttle( struct async_struct *info, int status );
- static void MFPbare_throttle( struct async_struct *info, int status );
- static void MFPser_set_break( struct async_struct *info, int break_flag );
- ***************
- *** 155,161 ****
- info->RI.bitno = ri_bitno;
- info->RI.active_state = ri_active;
- info->sw = (type == MFP_CTRL) ? &MFPctrl_switch :
- ! &MFPbare_switch;
-
- currMFP(info)->rcv_stat = 0; /* disable Rx */
- currMFP(info)->trn_stat = 0; /* disable Tx */
- --- 155,161 ----
- info->RI.bitno = ri_bitno;
- info->RI.active_state = ri_active;
- info->sw = (type == MFP_CTRL) ? &MFPctrl_switch :
- ! &MFPbare_switch;
-
- currMFP(info)->rcv_stat = 0; /* disable Rx */
- currMFP(info)->trn_stat = 0; /* disable Tx */
- ***************
- *** 407,417 ****
- }
-
-
- ! static void MFPser_restart( struct async_struct *info, int ch )
-
- {
- ! if (ch >= 0 && currMFP(info)->trn_stat & TSR_BUF_EMPTY)
- ! currMFP(info)->usart_dta = ch;
- }
-
-
- --- 407,419 ----
- }
-
-
- ! static void MFPser_restart( struct async_struct *info )
-
- {
- ! int ch;
- ! if (currMFP(info)->trn_stat & TSR_BUF_EMPTY)
- ! if ((ch = rs_get_char_from_queue (info)) >= 0)
- ! currMFP(info)->usart_dta = ch;
- }
-
-
- diff -cr --new-file linux-0.9pl1/drivers/char/atari_SCC.c linux-0.9pl2/drivers/char/atari_SCC.c
- *** linux-0.9pl1/drivers/char/atari_SCC.c Sun Jun 26 19:23:55 1994
- --- linux-0.9pl2/drivers/char/atari_SCC.c Sat Aug 6 20:38:48 1994
- ***************
- *** 24,30 ****
- #include <linux/atarihw.h>
- #include <linux/atariints.h>
-
- ! #include "atari_serial.h"
- #include "atari_MFPser.h"
-
-
- --- 24,30 ----
- #include <linux/atarihw.h>
- #include <linux/atariints.h>
-
- ! #include "serial.h"
- #include "atari_MFPser.h"
-
-
- diff -cr --new-file linux-0.9pl1/drivers/char/atari_SCC.h linux-0.9pl2/drivers/char/atari_SCC.h
- *** linux-0.9pl1/drivers/char/atari_SCC.h Sun Jun 26 19:23:56 1994
- --- linux-0.9pl2/drivers/char/atari_SCC.h Sat Aug 6 20:06:35 1994
- ***************
- *** 18,24 ****
- #define _ATARI_SCC_H
-
- #include <linux/atarihw.h>
- ! #include "atari_serial.h"
-
- /***********************************************************************/
- /* */
- --- 18,24 ----
- #define _ATARI_SCC_H
-
- #include <linux/atarihw.h>
- ! #include "serial.h"
-
- /***********************************************************************/
- /* */
- diff -cr --new-file linux-0.9pl1/drivers/char/atari_serial.c linux-0.9pl2/drivers/char/atari_serial.c
- *** linux-0.9pl1/drivers/char/atari_serial.c Sun Jun 26 19:23:58 1994
- --- linux-0.9pl2/drivers/char/atari_serial.c Wed Dec 31 19:00:00 1969
- ***************
- *** 1,983 ****
- -
- - /*
- - * drivers/char/atari_serial.c: Common source file for all Atari serial ports
- - *
- - * Copyright 1994 Roman Hodek
- - * EMail: rnhodek@cip.informatik.uni-erlangen.de (Internet)
- - * or: Roman_Hodek@n.maus.de (MausNet, NO mail > 16 KB!)
- - *
- - * Partially based on PC-Linux serial.c by Linus Torvalds and Theodore Ts'o
- - *
- - * This file is subject to the terms and conditions of the GNU General Public
- - * License. See the file README.legal in the main directory of this archive
- - * for more details.
- - *
- - */
- -
- - /*
- - * Notes and Design Goals:
- - * -----------------------
- - * The PC serial drivers can rely on the fact that all the serial
- - * hardware is very similar to program for all ports. Unfortunately,
- - * this is not true for the Atari. Here it is nearly the other way
- - * round: All ports need different treatment for the low-level stuff.
- - *
- - * For this reason, I split the serial driver code into a
- - * port-independent part (atari_serial.c) and port-specific parts
- - * (atari_*.c). The first manages all what can be done without
- - * accessing the hardware directly, i.e. interfacing with the
- - * high-level tty drivers, wait queues, managing the existing ports
- - * and the like. The latter do the actual hardware programming and are
- - * accessed by the hardware-independant part by a "switch" structure,
- - * that contains pointers to functions for specific tasks. See the
- - * comment before the definition of the SERIALSWITCH structure in
- - * atari_serial.h for more details.
- - *
- - * Despite its name, the port-independant code should be usable by
- - * other machines than Atari, too, if there are similar circumstances
- - * with different serial port hardware. Feel free to use it, but
- - * please inform me if you have to do changes to it. I'll try to keep
- - * it really device-independant.
- - *
- - */
- -
- -
- - #include <linux/types.h>
- - #include <linux/sched.h>
- - #include <linux/timer.h>
- - #include <linux/errno.h>
- - #include <linux/string.h>
- - #include <linux/bootinfo.h>
- - #include <linux/tty.h>
- - #include <linux/termios.h>
- - #include <linux/major.h>
- - #include <linux/fcntl.h>
- -
- - #include <asm/bitops.h>
- - #include <asm/segment.h>
- -
- - #include "atari_serial.h"
- - #include "atari_SCC.h"
- - #include "atari_MFPser.h"
- -
- -
- -
- - struct async_struct rs_table[ NR_PORTS ];
- - char rs_event[ (NR_PORTS + 7) / 8 ];
- -
- -
- -
- - /***************************** Prototypes *****************************/
- -
- - static inline void handle_rs_break( struct async_struct *info );
- - static void do_softint( void *unused );
- - static int startup( struct async_struct * info, int get_irq );
- - static void shutdown( struct async_struct * info, int do_free_irq );
- - static int get_serial_info( struct async_struct * info, struct
- - serial_struct * retinfo );
- - static int set_serial_info( struct async_struct * info, struct
- - serial_struct * new_info );
- - static int get_modem_info( struct async_struct * info, unsigned int *value
- - );
- - static int set_modem_info( struct async_struct * info, unsigned int cmd,
- - unsigned int *value );
- - static void send_break( struct async_struct * info, int duration );
- - static int rs_ioctl( struct tty_struct *tty, struct file * file, unsigned
- - int cmd, unsigned long arg );
- - static void rs_set_termios( struct tty_struct *tty, struct termios
- - *old_termios );
- - static void rs_close( struct tty_struct *tty, struct file * filp );
- - static int block_til_ready( struct tty_struct *tty, struct file * filp,
- - struct async_struct *info );
- -
- - /************************* End of Prototypes **************************/
- -
- -
- -
- - /*
- - * ------------------------------------------------------------
- - * rs_stop() and rs_start()
- - *
- - * This routines are called before setting or resetting tty->stopped.
- - * They enable or disable transmitter interrupts, as necessary.
- - * ------------------------------------------------------------ */
- -
- - void rs_stop( struct tty_struct *tty )
- -
- - {
- - struct async_struct *info;
- -
- - info = rs_table + DEV_TO_SL(tty->line);
- -
- - if (info->flags & ASYNC_CLOSING) {
- - tty->stopped = 0;
- - tty->hw_stopped = 0;
- - return;
- - }
- -
- - if (info->sw->enab_tx_int)
- - info->sw->enab_tx_int( info, 0 );
- - }
- -
- - void rs_start( struct tty_struct *tty )
- -
- - {
- - struct async_struct *info;
- -
- - info = rs_table + DEV_TO_SL(tty->line);
- -
- - if (info->sw->enab_tx_int) {
- - info->sw->enab_tx_int( info, 1 );
- - }
- - }
- -
- -
- - /*
- - * This routine is called when we receive a break on a serial line.
- - * It is executed out of the software interrupt routine.
- - */
- -
- - static inline void handle_rs_break( struct async_struct *info )
- -
- - {
- - if (info->flags & ASYNC_SAK)
- - do_SAK(info->tty);
- -
- - if (!I_IGNBRK(info->tty) && I_BRKINT(info->tty)) {
- - flush_input(info->tty);
- - flush_output(info->tty);
- - if (info->tty->pgrp > 0)
- - kill_pg(info->tty->pgrp, SIGINT, 1 );
- - }
- - }
- -
- - /*
- - * This routine is used to handle the "bottom half" processing for the
- - * serial driver, known also the "software interrupt" processing.
- - * This processing is done at the kernel interrupt level, after the
- - * rs_interrupt() has returned, BUT WITH INTERRUPTS TURNED ON. This
- - * is where time-consuming activities which can not be done in the
- - * interrupt driver proper are done; the interrupt driver schedules
- - * them using rs_sched_event(), and they get done here.
- - */
- - static void do_softint( void *unused )
- -
- - {
- - int i;
- - struct async_struct *info;
- -
- - for (i = 0, info = rs_table; i < NR_PORTS; i++,info++) {
- - if (clear_bit(i, rs_event)) {
- - if (!info->tty)
- - continue;
- - if (clear_bit(RS_EVENT_READ_PROCESS, &info->event)) {
- - TTY_READ_FLUSH(info->tty);
- - }
- - if (clear_bit(RS_EVENT_WRITE_WAKEUP, &info->event)) {
- - wake_up_interruptible(&info->tty->write_q.proc_list);
- - }
- - if (clear_bit(RS_EVENT_HANGUP, &info->event)) {
- - tty_hangup(info->tty);
- - wake_up_interruptible(&info->open_wait);
- - info->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CALLOUT_ACTIVE);
- - }
- - if (clear_bit(RS_EVENT_BREAK, &info->event))
- - handle_rs_break(info);
- - if (clear_bit(RS_EVENT_OPEN_WAKEUP, &info->event)) {
- - wake_up_interruptible(&info->open_wait);
- - }
- - }
- - }
- - }
- -
- - static int startup( struct async_struct * info, int get_irq )
- -
- - {
- - unsigned long flags;
- -
- - if (info->flags & ASYNC_INITIALIZED)
- - return 0;
- -
- - if (!info->base || !info->type) {
- - if (info->tty)
- - set_bit(TTY_IO_ERROR, &info->tty->flags);
- - return 0;
- - }
- -
- - save_flags(flags); cli();
- -
- - #ifdef SERIAL_DEBUG_OPEN
- - printk("starting up ttys%d (irq %d)...", info->line, info->irq);
- - #endif
- -
- - info->sw->init( info );
- -
- - if (info->tty)
- - clear_bit(TTY_IO_ERROR, &info->tty->flags);
- -
- - /*
- - * Set the speed and other port parameters.
- - */
- - info->sw->change_speed( info );
- -
- - info->flags |= ASYNC_INITIALIZED;
- - restore_flags(flags);
- - return 0;
- - }
- -
- - /*
- - * This routine will shutdown a serial port; interrupts are disabled, and
- - * DTR is dropped if the hangup on close termio flag is on.
- - */
- -
- - static void shutdown( struct async_struct * info, int do_free_irq )
- -
- - {
- - unsigned long flags;
- -
- - if (!(info->flags & ASYNC_INITIALIZED))
- - return;
- -
- - #ifdef SERIAL_DEBUG_OPEN
- - printk("Shutting down serial port %d (irq %d)....", info->line,
- - info->irq);
- - #endif
- -
- - save_flags(flags); cli(); /* Disable interrupts */
- -
- - info->sw->deinit( info, info->tty &&
- - !(info->tty->termios->c_cflag & HUPCL) );
- -
- - if (info->tty)
- - set_bit(TTY_IO_ERROR, &info->tty->flags);
- -
- - info->flags &= ~ASYNC_INITIALIZED;
- - restore_flags(flags);
- - }
- -
- -
- - /*
- - * ------------------------------------------------------------
- - * rs_write() and friends
- - * ------------------------------------------------------------
- - */
- -
- - /*
- - * This routine gets called when tty_write has put something into
- - * the write_queue.
- - */
- -
- - void rs_write( struct tty_struct * tty )
- -
- - { struct async_struct *info;
- -
- - if (!tty || tty->stopped || tty->hw_stopped)
- - return;
- - info = rs_table + DEV_TO_SL(tty->line);
- -
- - if (!info || !info->tty || !(info->flags & ASYNC_INITIALIZED))
- - return;
- -
- - cli();
- - info->sw->restart( info, rs_get_char_from_queue( info ) );
- - if (info->sw->enab_tx_int)
- - info->sw->enab_tx_int( info, 1 );
- - sti();
- - }
- -
- -
- - /*
- - * ------------------------------------------------------------
- - * rs_throttle()
- - *
- - * This routine is called by the upper-layer tty layer to signal that
- - * incoming characters should be throttled (and that the throttle
- - * should be released).
- - * ------------------------------------------------------------
- - */
- -
- - void rs_throttle( struct tty_struct * tty, int status )
- -
- - {
- - struct async_struct *info;
- - unsigned long flags;
- -
- - save_flags(flags); cli();
- - #if SERIAL_DEBUG_THROTTLE
- - printk("throttle tty%d: %d (%d, %d)....\n", DEV_TO_SL(tty->line),
- - status, LEFT(&tty->read_q), LEFT(&tty->secondary));
- - #endif
- -
- - switch( status ) {
- -
- - case TTY_THROTTLE_RQ_FULL:
- - info = rs_table + DEV_TO_SL(tty->line);
- - if (I_IXOFF(tty))
- - info->x_char = STOP_CHAR(tty);
- - else if (C_CRTSCTS(tty))
- - info->sw->throttle( info, status );
- - break;
- -
- - case TTY_THROTTLE_RQ_AVAIL:
- - info = rs_table + DEV_TO_SL(tty->line);
- - if (I_IXOFF(tty)) {
- - if (info->x_char)
- - info->x_char = 0;
- - else
- - info->x_char = START_CHAR(tty);
- - } else if (C_CRTSCTS(tty))
- - info->sw->throttle( info, status );
- - break;
- - }
- -
- - restore_flags(flags);
- - }
- -
- - /*
- - * ------------------------------------------------------------
- - * rs_ioctl() and friends
- - * ------------------------------------------------------------
- - */
- -
- - static int get_serial_info( struct async_struct * info,
- - struct serial_struct * retinfo )
- -
- - {
- - struct serial_struct tmp;
- -
- - if (!retinfo)
- - return -EFAULT;
- -
- - /* Set port-independant data */
- - memset(&tmp, 0, sizeof(tmp));
- - tmp.type = info->type;
- - tmp.line = info->line;
- - tmp.port = 0; /* meaningless for non-Intel */
- - tmp.irq = 0; /* meaningless for Atari */
- - tmp.flags = info->flags;
- - tmp.close_delay = info->close_delay;
- - tmp.hub6 = 0; /* meaningless for Atari */
- -
- - /* At least baud_base and costum_divisor set by port-specific
- - * function
- - */
- - info->sw->get_serial_info( info, &tmp );
- -
- - memcpy_tofs( retinfo, &tmp, sizeof(*retinfo) );
- - return 0;
- - }
- -
- -
- - static int set_serial_info( struct async_struct * info,
- - struct serial_struct * new_info )
- -
- - {
- - struct serial_struct new_serial;
- - struct async_struct old_info;
- -
- - if (!new_info) return( -EFAULT );
- - memcpy_fromfs( &new_serial, new_info, sizeof(new_serial) );
- - old_info = *info;
- -
- - /* The fields type, line, port, irq, xmit_fifo_size, baud_base and
- - * hub6 of new_info are silently ignored for the Atari, since they
- - * are meaningless or cannot be changed, resp. Is this right or
- - * should an error be returned?
- - */
- -
- - /* If a new custom divisor is to be set, let it check by the
- - * hardware specific code first!
- - */
- - if (new_serial.custom_divisor != info->custom_divisor) {
- - if (info->sw->check_custom_divisor( info, new_serial.custom_divisor ))
- - return( -EINVAL );
- - }
- -
- - if (!suser()) {
- - if ((new_serial.close_delay != info->close_delay) ||
- - ((new_serial.flags & ~ASYNC_USR_MASK) !=
- - (info->flags & ~ASYNC_USR_MASK))) return( -EPERM );
- -
- - info->flags = ((info->flags & ~ASYNC_USR_MASK) |
- - (new_serial.flags & ASYNC_USR_MASK));
- - info->custom_divisor = new_serial.custom_divisor;
- - goto check_and_exit;
- - }
- -
- - /*
- - * OK, past this point, all the error checking has been done.
- - * At this point, we start making changes.....
- - */
- -
- - info->flags = ((info->flags & ~ASYNC_FLAGS) |
- - (new_serial.flags & ASYNC_FLAGS));
- - info->custom_divisor = new_serial.custom_divisor;
- - info->close_delay = new_serial.close_delay;
- -
- - check_and_exit:
- - if (info->flags & ASYNC_INITIALIZED) {
- -
- - if (((old_info.flags & ASYNC_SPD_MASK) !=
- - (info->flags & ASYNC_SPD_MASK)) ||
- - (old_info.custom_divisor != info->custom_divisor))
- - info->sw->change_speed( info );
- - }
- - else
- - (void)startup( info, 0 );
- -
- - return 0;
- - }
- -
- - static int get_modem_info( struct async_struct * info,
- - unsigned int *value )
- -
- - {
- - unsigned int result;
- -
- - result = info->sw->get_modem_info( info );
- - put_fs_long( result, (unsigned long *) value );
- -
- - return 0;
- - }
- -
- -
- - static int set_modem_info( struct async_struct * info, unsigned int cmd,
- - unsigned int *value )
- -
- - { unsigned arg = get_fs_long((unsigned long *) value);
- - int new_dtr = -1, new_rts = -1;
- -
- - switch( cmd ) {
- -
- - case TIOCMBIS:
- - if (arg & TIOCM_DTR) new_dtr = 1;
- - if (arg & TIOCM_RTS) new_rts = 1;
- - break;
- -
- - case TIOCMBIC:
- - if (arg & TIOCM_DTR) new_dtr = 0;
- - if (arg & TIOCM_RTS) new_rts = 0;
- - break;
- -
- - case TIOCMSET:
- - new_dtr = !!(arg & TIOCM_DTR);
- - new_rts = !!(arg & TIOCM_RTS);
- - break;
- -
- - default:
- - return( -EINVAL );
- - }
- -
- - return( info->sw->set_modem_info( info, new_dtr, new_rts ) );
- - }
- -
- -
- - /*
- - * This routine sends a break out the serial port.
- - */
- -
- - static void send_break( struct async_struct * info, int duration )
- -
- - {
- - if (!info->base) return;
- -
- - current->state = TASK_INTERRUPTIBLE;
- - current->timeout = jiffies + duration;
- - cli();
- - info->sw->set_break( info, 1 );
- - schedule();
- - info->sw->set_break( info, 0 );
- - sti();
- - }
- -
- - static int rs_ioctl( struct tty_struct *tty, struct file * file,
- - unsigned int cmd, unsigned long arg )
- -
- - {
- - int error, line;
- - struct async_struct * info;
- -
- - line = DEV_TO_SL(tty->line);
- - if (line < 0 || line >= NR_PORTS)
- - return -ENODEV;
- - info = rs_table + line;
- - if (!info->base) return( -ENODEV );
- -
- - switch( cmd ) {
- - case TCSBRK: /* SVID version: non-zero arg --> no break */
- - if (!arg)
- - send_break(info, HZ/4); /* 1/4 second */
- - return 0;
- - case TCSBRKP: /* support for POSIX tcsendbreak() */
- - send_break(info, arg ? arg*(HZ/10) : HZ/4);
- - return 0;
- - case TIOCGSOFTCAR:
- - error = verify_area(VERIFY_WRITE, (void *) arg,sizeof(long));
- - if (error)
- - return error;
- - put_fs_long(C_CLOCAL(tty) ? 1 : 0, (unsigned long *) arg);
- - return 0;
- - case TIOCSSOFTCAR:
- - arg = get_fs_long((unsigned long *) arg);
- - tty->termios->c_cflag =
- - ((tty->termios->c_cflag & ~CLOCAL) | (arg ? CLOCAL : 0));
- - return 0;
- - case TIOCMGET:
- - error = verify_area(VERIFY_WRITE, (void *) arg,
- - sizeof(unsigned int));
- - if (error)
- - return error;
- - return get_modem_info(info, (unsigned int *) arg);
- - case TIOCMBIS:
- - case TIOCMBIC:
- - case TIOCMSET:
- - return set_modem_info(info, cmd, (unsigned int *) arg);
- - case TIOCGSERIAL:
- - error = verify_area(VERIFY_WRITE, (void *) arg,
- - sizeof(struct serial_struct));
- - if (error)
- - return error;
- - return get_serial_info(info, (struct serial_struct *) arg);
- - case TIOCSSERIAL:
- - return set_serial_info(info, (struct serial_struct *) arg);
- - case TIOCSERCONFIG:
- - /* return do_autoconfig(info); */
- - return( 0 );
- -
- - default:
- - if (info->sw->ioctl)
- - return( info->sw->ioctl( tty, file, info, cmd, arg ) );
- - else
- - return( -EINVAL );
- - }
- - return 0;
- - }
- -
- -
- - static void rs_set_termios( struct tty_struct *tty,
- - struct termios *old_termios )
- -
- - {
- - struct async_struct *info;
- -
- - if (tty->termios->c_cflag == old_termios->c_cflag)
- - return;
- -
- - info = &rs_table[DEV_TO_SL(tty->line)];
- -
- - info->sw->change_speed( info );
- -
- - if ((old_termios->c_cflag & CRTSCTS) &&
- - !(tty->termios->c_cflag & CRTSCTS)) {
- - tty->hw_stopped = 0;
- - rs_write(tty);
- - }
- -
- - if (!(old_termios->c_cflag & CLOCAL) &&
- - (tty->termios->c_cflag & CLOCAL))
- - wake_up_interruptible(&info->open_wait);
- - }
- -
- -
- - /*
- - * ------------------------------------------------------------
- - * rs_close()
- - *
- - * This routine is called when the serial port gets closed. First, we
- - * wait for the last remaining data to be sent. Then, we unlink its
- - * async structure from the interrupt chain if necessary, and we free
- - * that IRQ if nothing is left in the chain.
- - * ------------------------------------------------------------
- - */
- -
- - static void rs_close( struct tty_struct *tty, struct file * filp )
- -
- - {
- - struct async_struct * info;
- - int line;
- -
- - if (tty_hung_up_p(filp)) return;
- -
- - line = DEV_TO_SL(tty->line);
- - if ((line < 0) || (line >= NR_PORTS)) return;
- - info = rs_table + line;
- - if (!info->base) return;
- -
- - #ifdef SERIAL_DEBUG_OPEN
- - printk("rs_close ttys%d, count = %d\n", info->line, info->count);
- - #endif
- -
- - if ((tty->count == 1) && (info->count != 1)) {
- - /*
- - * Uh, oh. tty->count is 1, which means that the tty
- - * structure will be freed. Info->count should always
- - * be one in these conditions. If it's greater than
- - * one, we've got real problems, since it means the
- - * serial port won't be shutdown.
- - */
- - printk("rs_close: bad serial port count; tty->count is 1, "
- - "info->count is %d\n", info->count);
- - info->count = 1;
- - }
- - if (--info->count < 0) {
- - printk("rs_close: bad serial port count for ttys%d: %d\n",
- - info->line, info->count);
- - info->count = 0;
- - }
- - if (info->count)
- - return;
- - info->flags |= ASYNC_CLOSING;
- - /*
- - * Save the termios structure, since this port may have
- - * separate termios for callout and dialin.
- - */
- - if (info->flags & ASYNC_NORMAL_ACTIVE)
- - info->normal_termios = *tty->termios;
- - if (info->flags & ASYNC_CALLOUT_ACTIVE)
- - info->callout_termios = *tty->termios;
- - tty->stopped = 0; /* Force flush to succeed */
- - tty->hw_stopped = 0;
- - if (info->flags & ASYNC_INITIALIZED) {
- - rs_start(tty);
- - wait_until_sent(tty, 6000); /* 60 seconds timeout */
- - } else
- - flush_output(tty);
- - flush_input(tty);
- -
- - shutdown(info, 1);
- - clear_bit(line, rs_event);
- - info->event = 0;
- - info->tty = 0;
- - if (info->blocked_open) {
- - if (info->close_delay) {
- - tty->count++; /* avoid race condition */
- - current->state = TASK_INTERRUPTIBLE;
- - current->timeout = jiffies + info->close_delay;
- - schedule();
- - tty->count--;
- - }
- - wake_up_interruptible(&info->open_wait);
- - }
- - info->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CALLOUT_ACTIVE|ASYNC_CLOSING);
- - wake_up_interruptible(&info->close_wait);
- - }
- -
- -
- - /*
- - * rs_hangup() --- called by tty_hangup() when a hangup is signaled.
- - */
- -
- - void rs_hangup( struct tty_struct *tty )
- -
- - {
- - struct async_struct * info;
- - int line;
- -
- - line = DEV_TO_SL(tty->line);
- - if ((line < 0) || (line >= NR_PORTS)) return;
- - info = rs_table + line;
- - if (!info->base) return;
- -
- - shutdown(info, 1);
- - clear_bit(line, rs_event);
- - info->event = 0;
- - info->count = 0;
- - info->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CALLOUT_ACTIVE);
- - info->tty = 0;
- - wake_up_interruptible(&info->open_wait);
- - }
- -
- -
- - /*
- - * ------------------------------------------------------------
- - * rs_open() and friends
- - * ------------------------------------------------------------
- - */
- -
- - static int block_til_ready( struct tty_struct *tty, struct file * filp,
- - struct async_struct *info )
- -
- - {
- - struct wait_queue wait = { current, NULL };
- - int retval;
- - int do_clocal = C_CLOCAL(tty);
- -
- - /*
- - * If the device is in the middle of being closed, then block
- - * until it's done, and then try again.
- - */
- - if (info->flags & ASYNC_CLOSING) {
- - interruptible_sleep_on(&info->close_wait);
- - #ifdef SERIAL_DO_RESTART
- - if (info->flags & ASYNC_HUP_NOTIFY)
- - return -EAGAIN;
- - else
- - return -ERESTARTSYS;
- - #else
- - return -EAGAIN;
- - #endif
- - }
- -
- - /*
- - * If this is a callout device, then just make sure the normal
- - * device isn't being used.
- - */
- - if (MAJOR(filp->f_rdev) == TTYAUX_MAJOR) {
- - if (info->flags & ASYNC_NORMAL_ACTIVE)
- - return -EBUSY;
- - if ((info->flags & ASYNC_CALLOUT_ACTIVE) &&
- - (info->flags & ASYNC_SESSION_LOCKOUT) &&
- - (info->session != current->session))
- - return -EBUSY;
- - if ((info->flags & ASYNC_CALLOUT_ACTIVE) &&
- - (info->flags & ASYNC_PGRP_LOCKOUT) &&
- - (info->pgrp != current->pgrp))
- - return -EBUSY;
- - info->flags |= ASYNC_CALLOUT_ACTIVE;
- - return 0;
- - }
- -
- - /*
- - * If non-blocking mode is set, then make the check up front
- - * and then exit.
- - */
- - if (filp->f_flags & O_NONBLOCK) {
- - if (info->flags & ASYNC_CALLOUT_ACTIVE)
- - return -EBUSY;
- - info->flags |= ASYNC_NORMAL_ACTIVE;
- - return 0;
- - }
- -
- - /*
- - * Block waiting for the carrier detect and the line to become
- - * free (i.e., not in use by the callout). While we are in
- - * this loop, info->count is dropped by one, so that
- - * rs_close() knows when to free things. We restore it upon
- - * exit, either normal or abnormal.
- - */
- - retval = 0;
- - add_wait_queue(&info->open_wait, &wait);
- - #ifdef SERIAL_DEBUG_OPEN
- - printk("block_til_ready before block: ttys%d, count = %d\n",
- - info->line, info->count);
- - #endif
- - info->count--;
- - info->blocked_open++;
- - while (1) {
- - cli();
- - if (!(info->flags & ASYNC_CALLOUT_ACTIVE))
- - info->sw->set_modem_info( info, 1, 1 );
- - sti();
- - current->state = TASK_INTERRUPTIBLE;
- - if (tty_hung_up_p(filp) ||
- - !(info->flags & ASYNC_INITIALIZED)) {
- - #ifdef SERIAL_DO_RESTART
- - if (info->flags & ASYNC_HUP_NOTIFY)
- - retval = -EAGAIN;
- - else
- - retval = -ERESTARTSYS;
- - #else
- - retval = -EAGAIN;
- - #endif
- - break;
- - }
- - if (!(info->flags & ASYNC_CALLOUT_ACTIVE) &&
- - !(info->flags & ASYNC_CLOSING) &&
- - (do_clocal || (info->sw->get_modem_info( info ) & TIOCM_CAR)))
- - break;
- - if (current->signal & ~current->blocked) {
- - retval = -ERESTARTSYS;
- - break;
- - }
- - #ifdef SERIAL_DEBUG_OPEN
- - printk("block_til_ready blocking: ttys%d, count = %d\n",
- - info->line, info->count);
- - #endif
- - schedule();
- - }
- - current->state = TASK_RUNNING;
- - remove_wait_queue(&info->open_wait, &wait);
- - if (!tty_hung_up_p(filp))
- - info->count++;
- - info->blocked_open--;
- - #ifdef SERIAL_DEBUG_OPEN
- - printk("block_til_ready after blocking: ttys%d, count = %d\n",
- - info->line, info->count);
- - #endif
- - if (retval)
- - return retval;
- - info->flags |= ASYNC_NORMAL_ACTIVE;
- - return 0;
- - }
- -
- -
- - /*
- - * This routine is called whenever a serial port is opened.
- - */
- -
- - int rs_open( struct tty_struct *tty, struct file * filp )
- -
- - {
- - struct async_struct *info;
- - int retval, line;
- -
- - line = DEV_TO_SL(tty->line);
- - if ((line < 0) || (line >= NR_PORTS))
- - return( -ENODEV );
- - info = rs_table + line;
- - if (!info->base)
- - return( -ENODEV );
- -
- - #ifdef SERIAL_DEBUG_OPEN
- - printk("rs_open ttyS%d, count = %d\n", info->line, info->count);
- - #endif
- - info->count++;
- - info->tty = tty;
- -
- - tty->write = rs_write;
- - tty->close = rs_close;
- - tty->ioctl = rs_ioctl;
- - tty->throttle = rs_throttle;
- - tty->set_termios = rs_set_termios;
- - tty->stop = rs_stop;
- - tty->start = rs_start;
- - tty->hangup = rs_hangup;
- -
- - if ((info->count == 1) && (info->flags & ASYNC_SPLIT_TERMIOS)) {
- - if (MAJOR(filp->f_rdev) == TTY_MAJOR)
- - *tty->termios = info->normal_termios;
- - else
- - *tty->termios = info->callout_termios;
- - }
- -
- - /*
- - * Start up serial port
- - */
- - if ((retval = startup(info, 1))) return retval;
- -
- - retval = block_til_ready(tty, filp, info);
- - if (retval) {
- - #ifdef SERIAL_DEBUG_OPEN
- - printk( "rs_open returning after block_til_ready with %d\n", retval );
- - #endif
- - return retval;
- - }
- -
- - info->session = current->session;
- - info->pgrp = current->pgrp;
- -
- - #ifdef SERIAL_DEBUG_OPEN
- - printk("rs_open ttyS%d successfull...", info->line);
- - #endif
- - return 0;
- - }
- -
- -
- -
- - /*
- - * Boot-time initialization code: Init the serial ports present on
- - * this machine type.
- - *
- - * Current HW Port to minor/device name mapping:
- - *
- - * TT | Falcon || minor | name
- - * -----------------------+---------------------------++-------+-------
- - * SCC B (Modem2) | SCC B (Modem) || 64 | ttyS0
- - * SCC A (Serial2/LAN) | SCC A (LAN) || 65 | ttyS1
- - * ST-MFP port (Modem1) | -- || 66 | ttyS2
- - * TT-MFP port (Serial1) | ST-MFP port (no TOS name) || 67 | ttyS3
- - *
- - * The background of this mapping is that I wanted to assign the same
- - * minors to ports with the same capabilities. Staring with the MFPs
- - * would leave a hole in the first position on the Falcon!
- - *
- - * Should Serial2/LAN on the TT be split into two devices, selecting thus
- - * the connector used? Serial2 would be unassigned on the Falcon, and
- - * if one is open, opening the other would block.
- - *
- - */
- -
- - long rs_init( long kmem_start )
- -
- - { int i;
- - struct async_struct *info;
- -
- - if (boot_info.machtype != MACH_ATARI) return( kmem_start );
- -
- - memset( &rs_event, 0, sizeof(rs_event) );
- - bh_base[SERIAL_BH].routine = do_softint;
- -
- - /* Initialize the async_struct's */
- - for( i = 0, info = rs_table; i < NR_PORTS; i++, info++ ) {
- - info->line = i;
- - info->base = NULL;
- - info->tty = 0;
- - info->type = PORT_UNKNOWN;
- - info->custom_divisor = 0;
- - info->close_delay = 50;
- - info->x_char = 0;
- - info->event = 0;
- - info->count = 0;
- - info->blocked_open = 0;
- - memset(&info->callout_termios, 0, sizeof(struct termios));
- - memset(&info->normal_termios, 0, sizeof(struct termios));
- - info->open_wait = 0;
- - info->xmit_wait = 0;
- - info->close_wait = 0;
- - }
- -
- - /* Now initialize the ports themselves */
- - switch( boot_info.bi_atari.model ) {
- -
- - case ATARI_TT:
- - atari_init_SCC(
- - &rs_table[0],
- - SCC_NORM, /* type */
- - 1, /* Channel B */
- - (void *)&tt_mfp.par_dt_reg, 3, 0/* RI */
- - );
- - atari_init_SCC(
- - &rs_table[1],
- - SCC_DMA, /* type */
- - 0, /* Channel A */
- - 0, 0, 0 /* no RI */
- - );
- - atari_init_MFPser(
- - &rs_table[2],
- - MFP_CTRL, /* type */
- - 0, /* ST-MFP */
- - (void *)&mfp.par_dt_reg, 6, 0 /* RI */
- - );
- - atari_init_MFPser(
- - &rs_table[3],
- - MFP_BARE, /* type */
- - 1, /* TT_MFP */
- - 0, 0, 0 /* no RI */
- - );
- - break;
- -
- - case ATARI_FALCON:
- - atari_init_SCC(
- - &rs_table[0],
- - SCC_NORM, /* type */
- - 1, /* Channel B */
- - (void *)&mfp.par_dt_reg, 6, 0 /* RI */
- - );
- - atari_init_SCC(
- - &rs_table[1],
- - SCC_NORM, /* type */
- - 0, /* Channel A */
- - 0, 0, 0 /* no RI */
- - );
- - atari_init_MFPser(
- - &rs_table[3],
- - MFP_BARE, /* type */
- - 0, /* ST-MFP */
- - 0, 0, 0 /* no RI */
- - );
- - break;
- -
- - }
- -
- - return( kmem_start );
- - }
- --- 0 ----
- diff -cr --new-file linux-0.9pl1/drivers/char/atari_serial.h linux-0.9pl2/drivers/char/atari_serial.h
- *** linux-0.9pl1/drivers/char/atari_serial.h Sun Jun 26 22:42:24 1994
- --- linux-0.9pl2/drivers/char/atari_serial.h Wed Dec 31 19:00:00 1969
- ***************
- *** 1,324 ****
- -
- - /*
- - * atari_serial.h: Common definitions for all Atari serial ports
- - *
- - * Copyright 1994 Roman Hodek
- - * EMail: rnhodek@cip.informatik.uni-erlangen.de (Internet)
- - * or: Roman_Hodek@n.maus.de (MausNet, NO mail > 16 KB!)
- - *
- - * This file is subject to the terms and conditions of the GNU General Public
- - * License. See the file README.legal in the main directory of this archive
- - * for more details.
- - *
- - */
- -
- -
- - #ifndef _ATARI_SERIAL_H
- - #define _ATARI_SERIAL_H
- -
- - #include <linux/tty.h>
- -
- - /* 4 is sufficient for now... */
- - #define NR_PORTS 4
- -
- -
- - /* Structure describing one bit in a register that may be high- or
- - * low-active. This is used for RI detection, because the location of
- - * this signal varies widely. The function TEST_BITPOS() is provided
- - * to return the status of such a bit.
- - */
- -
- - typedef struct {
- - volatile unsigned char *addr; /* address of register */
- - unsigned char bitno; /* bit#, 0..7 */
- - unsigned char active_state; /* 1 for high-active,
- - * 0 for * low-active */
- - } BITPOS;
- -
- - static __inline__ int TEST_BITPOS( BITPOS bp )
- -
- - {
- - return( !bp.addr ? 0 :
- - !!(*(bp.addr) & (1 << bp.bitno)) == bp.active_state );
- - }
- -
- -
- - /* Atari serial port types are numbered from 100 to avoid interference
- - * with the PC types (1..4)
- - */
- - typedef enum {
- - SCC_NORM = 100, /* standard SCC channel */
- - SCC_DMA, /* SCC channel with DMA support */
- - MFP_CTRL, /* standard MFP port with modem control signals */
- - MFP_BARE, /* MFP port without modem controls */
- - } SERTYPE;
- -
- - /* This function tables does the abstraction from the underlying
- - * hardware:
- - *
- - * init(): Initialize the port as necessary, set RTS and DTR and
- - * enable interrupts. It does not need to set the speed and other
- - * parameters, because change_speed() is called, too.
- - * deinit(): Stop the port (wait for all characters to be sent,
- - * disable interrupts)
- - * enab_tx_int(): Enable or disable the Tx Buffer Empty interrupt
- - * independantly from other interrupt sources. The pointer to
- - * this function may be NULL, if there is no way to do this or it
- - * is too complex. This Tx ints are just disabled to save some
- - * interrupts if the transmitter is stopped anyway.
- - * check_custom_divisor(): Check the given custom divisor for legality
- - * and return 0 if OK, non-zero otherwise.
- - * change_speed(): Set port speed, character size, number of stop
- - * bits and parity from the termios structure. If the user wants
- - * to set the speed with a custom divisor, he is required to
- - * check the baud_base first!
- - * restart(): Is called every time new data arrived in the Tx queue
- - * and may be used to restart the transmitter if it ran empty.
- - * 'c' is the first character to be output or -1 if there is
- - * none. If more than one character can be written (FIFOs!), you
- - * have to take the remaining ones from the write queue directly.
- - * This function is called with interrupts off.
- - * throttle(): Set or clear the RTS line according to 'status'.
- - * set_break(): Set or clear the 'Send a Break' flag.
- - * get_serial_info(): Fill in the baud_base and custom_divisor
- - * fields of a serial_struct. It may also modify other fields, if
- - * needed.
- - * get_modem_info(): Return the status of RTS, DTR, DCD, RI, DSR and CTS.
- - * set_modem_info(): Set the status of RTS and DTR according to
- - * 'new_dtr' and 'new_rts', resp. 0 = clear, 1 = set, -1 = don't change
- - * ioctl(): Process any port-specific ioctl's. This pointer may be
- - * NULL, if the port has no own ioctl's.
- - *
- - */
- -
- - struct async_struct;
- -
- - typedef struct {
- - void (*init)( struct async_struct *info );
- - void (*deinit)( struct async_struct *info, int leave_dtr );
- - void (*enab_tx_int)( struct async_struct *info, int enab_flag );
- - int (*check_custom_divisor)( struct async_struct *info, int divisor );
- - void (*change_speed)( struct async_struct *info );
- - void (*restart)( struct async_struct *info, int c );
- - void (*throttle)( struct async_struct *info, int status );
- - void (*set_break)( struct async_struct *info, int break_flag );
- - void (*get_serial_info)( struct async_struct *info,
- - struct serial_struct *retinfo );
- - unsigned int (*get_modem_info)( struct async_struct *info );
- - int (*set_modem_info)( struct async_struct *info, int new_dtr,
- - int new_rts );
- - int (*ioctl)( struct tty_struct *tty, struct file *file,
- - struct async_struct *info, unsigned int cmd,
- - unsigned long arg );
- - } SERIALSWITCH;
- -
- -
- - /* This is a modified version of the PC-Linux async_struct. Mainly,
- - * stuff like port address, xmit_fifo_size and the like are left out
- - * and other information fields were added.
- - */
- -
- - struct async_struct {
- - /* Atari specific fields */
- - SERTYPE type; /* UART type */
- - volatile void *base; /* base address */
- - BITPOS RI; /* Where the Ring Indicator is signalled */
- - SERIALSWITCH *sw; /* functions to manage this port */
- - /* common fields */
- - int flags;
- - struct tty_struct *tty;
- - int timeout;
- - int custom_divisor;
- - int x_char; /* xon/xoff characater */
- - int close_delay;
- - int event;
- - int line;
- - int count; /* # of fd on device */
- - int blocked_open; /* # of blocked opens */
- - long session; /* Session of opening process */
- - long pgrp; /* pgrp of opening process */
- - struct termios normal_termios;
- - struct termios callout_termios;
- - struct wait_queue *open_wait;
- - struct wait_queue *close_wait;
- - struct wait_queue *xmit_wait;
- - };
- -
- - /*
- - * Events are used to schedule things to happen at timer-interrupt
- - * time, instead of at rs interrupt time.
- - */
- - #define RS_EVENT_READ_PROCESS 0
- - #define RS_EVENT_WRITE_WAKEUP 1
- - #define RS_EVENT_HANGUP 2
- - #define RS_EVENT_BREAK 3
- - #define RS_EVENT_OPEN_WAKEUP 4
- -
- -
- -
- - /***************************** Prototypes *****************************/
- -
- - void rs_stop( struct tty_struct *tty );
- - void rs_start( struct tty_struct *tty );
- - void rs_write( struct tty_struct * tty );
- - void rs_throttle( struct tty_struct * tty, int status );
- - void rs_hangup( struct tty_struct *tty );
- - int rs_open( struct tty_struct *tty, struct file * filp );
- - long rs_init( long kmem_start );
- -
- - /************************* End of Prototypes **************************/
- -
- -
- -
- - /*************************** Inline Functions *************************/
- -
- -
- - #include <linux/interrupt.h>
- - #include <asm/bitops.h>
- -
- - /*
- - * This routine is used by the interrupt handler to schedule
- - * processing in the software interrupt portion of the driver.
- - * It is needed in the port-specific interrupt handlers, so it is
- - * declared here in the common header.
- - */
- -
- - extern char rs_event[];
- -
- - static inline void rs_sched_event( struct async_struct *info, int event )
- -
- - {
- - info->event |= 1 << event;
- - set_bit(info->line, rs_event);
- - mark_bh(SERIAL_BH);
- - }
- -
- -
- - /* The following functions do common tasks needed in the interrupt
- - * service routine(s):
- - *
- - * - Putting a character into the read_queue, either with or without
- - * an error condition, and waking up processes waiting for
- - * something to arrive
- - * - Check if a throttle is needed due to the read queue getting full
- - * - Removing a character from the write queue, obeying pending flow
- - * control characters
- - * - Checking for enough characters in the write queue to wake up
- - * sleeping processes
- - * - Doing required actions on wait queues if DCD has changed
- - * - Doing required actions on wait queues if CTS has changed;
- - * returns non-zero, if the transmitter should be restarted
- - */
- -
- - static __inline__ void rs_put_char_to_queue( struct async_struct *info,
- - int c, int err )
- -
- - { struct tty_queue *q = &info->tty->read_q;
- -
- - if (!FULL(q)) {
- -
- - if (err) {
- - if (err == TTY_BREAK)
- - rs_sched_event( info, RS_EVENT_BREAK );
- -
- - /* ignore parity errors if parity checking isn't enabled. */
- - if (!(err == TTY_PARITY && !I_INPCK(info->tty))) {
- - set_bit( q->head, &info->tty->readq_flags );
- - c = err;
- - }
- - }
- -
- - q->buf[q->head] = c;
- - INC(q->head);
- -
- - rs_sched_event( info, RS_EVENT_READ_PROCESS );
- - }
- - }
- -
- -
- - static __inline__ void rs_rx_throttle_if_needed( struct async_struct *info )
- -
- - { struct tty_queue *q = &info->tty->read_q;
- -
- - if (LEFT(q) < RQ_THRESHOLD_LW &&
- - !set_bit( TTY_RQ_THROTTLED, &info->tty->flags))
- -
- - rs_throttle( info->tty, TTY_THROTTLE_RQ_FULL );
- - }
- -
- -
- - static __inline__ int rs_get_char_from_queue( struct async_struct *info )
- -
- - { int ch;
- - struct tty_queue *q = &info->tty->write_q;
- -
- - if (info->x_char) {
- - ch = info->x_char;
- - info->x_char = 0;
- - }
- - else if (!EMPTY(q)) {
- - ch = q->buf[q->tail];
- - INC(q->tail);
- - }
- - else {
- - rs_stop( info->tty );
- - ch = -1;
- - }
- -
- - return( ch );
- - }
- -
- -
- - static __inline__ void rs_tx_wakeup_if_needed( struct async_struct *info )
- -
- - { struct tty_queue *q = &info->tty->write_q;
- -
- - if (LEFT(q) > WAKEUP_CHARS) {
- - rs_sched_event( info, RS_EVENT_WRITE_WAKEUP );
- - if (info->tty->write_data_cnt) {
- - set_bit( info->tty->line, &tty_check_write );
- - mark_bh( TTY_BH );
- - }
- - }
- - }
- -
- -
- - static __inline__ void rs_dcd_changed( struct async_struct *info, int dcd )
- -
- - {
- - if (!C_CLOCAL(info->tty)) {
- -
- - if (dcd)
- - rs_sched_event( info, RS_EVENT_OPEN_WAKEUP );
- - else if (!((info->flags & ASYNC_CALLOUT_ACTIVE) &&
- - (info->flags & ASYNC_CALLOUT_NOHUP)))
- - rs_sched_event( info, RS_EVENT_HANGUP );
- - }
- - }
- -
- -
- - static __inline__ int rs_cts_changed( struct async_struct *info, int cts )
- -
- - {
- - if (!C_CRTSCTS(info->tty) || (info->flags & ASYNC_CLOSING))
- - return( 0 );
- -
- - if (info->tty->hw_stopped) {
- - if (cts) {
- - info->tty->hw_stopped = 0;
- - rs_start( info->tty );
- - return( 1 );
- - }
- - }
- - else {
- - if (!cts) {
- - info->tty->hw_stopped = 1;
- - rs_stop( info->tty );
- - }
- - }
- -
- - return( 0 );
- - }
- -
- -
- - #endif /* _ATARI_SERIAL_H */
- --- 0 ----
- diff -cr --new-file linux-0.9pl1/drivers/char/console.c linux-0.9pl2/drivers/char/console.c
- *** linux-0.9pl1/drivers/char/console.c Sun Jun 26 19:05:29 1994
- --- linux-0.9pl2/drivers/char/console.c Sun Aug 7 16:27:39 1994
- ***************
- *** 405,411 ****
- case 1: /* erase from start to cursor */
- /* 680x0 do in two stages */
- sw->con_clear(&vc_cons[currcons],0,0,y, video_num_columns);
- ! sw->con_clear(&vc_cons[currcons],y,0,1,x);
- break;
- case 2: /* erase whole display */
- sw->con_clear(&vc_cons[currcons],0,0,video_num_lines, video_num_columns);
- --- 405,411 ----
- case 1: /* erase from start to cursor */
- /* 680x0 do in two stages */
- sw->con_clear(&vc_cons[currcons],0,0,y, video_num_columns);
- ! sw->con_clear(&vc_cons[currcons],y,0,1,x + 1);
- break;
- case 2: /* erase whole display */
- sw->con_clear(&vc_cons[currcons],0,0,video_num_lines, video_num_columns);
- ***************
- *** 423,429 ****
- sw->con_clear(&vc_cons[currcons],y,x,1,video_num_columns-x);
- break;
- case 1: /* erase from start of line to cursor */
- ! sw->con_clear(&vc_cons[currcons],y,0,1,x);
- break;
- case 2: /* erase whole line */
- sw->con_clear(&vc_cons[currcons],y,0,1,video_num_columns);
- --- 423,429 ----
- sw->con_clear(&vc_cons[currcons],y,x,1,video_num_columns-x);
- break;
- case 1: /* erase from start of line to cursor */
- ! sw->con_clear(&vc_cons[currcons],y,0,1,x + 1);
- break;
- case 2: /* erase whole line */
- sw->con_clear(&vc_cons[currcons],y,0,1,video_num_columns);
- ***************
- *** 683,689 ****
- /*
- * Print the erase char on the current position
- */
- ! sw->con_putc(&vc_cons[currcons],(video_erase_char & 0x00ff),y,x,DM_COPY);
-
- need_wrap = 0;
- }
- --- 683,689 ----
- /*
- * Print the erase char on the current position
- */
- ! sw->con_putc(&vc_cons[currcons],(video_erase_char & 0x00ff),y,x,reverse ? DM_INVERSE : DM_COPY);
-
- need_wrap = 0;
- }
- ***************
- *** 698,704 ****
- 1, video_num_columns - x - nr);
- while (nr--)
- sw->con_putc (&vc_cons[currcons], video_erase_char & 0x00ff,
- ! y, x + nr, DM_COPY);
- need_wrap = 0;
- }
-
- --- 698,704 ----
- 1, video_num_columns - x - nr);
- while (nr--)
- sw->con_putc (&vc_cons[currcons], video_erase_char & 0x00ff,
- ! y, x + nr, reverse ? DM_INVERSE : DM_COPY);
- need_wrap = 0;
- }
-
- ***************
- *** 724,730 ****
-
- while (nr--)
- sw->con_putc (&vc_cons[currcons], video_erase_char & 0x00ff,
- ! y, video_num_columns - 1 - nr, DM_COPY);
-
- need_wrap = 0;
- }
- --- 724,731 ----
-
- while (nr--)
- sw->con_putc (&vc_cons[currcons], video_erase_char & 0x00ff,
- ! y, video_num_columns - 1 - nr, reverse ? DM_INVERSE
- ! : DM_COPY);
-
- need_wrap = 0;
- }
- ***************
- *** 863,869 ****
-
- if (nextx == cols) {
- sw->con_putc(&vc_cons[currcons],
- ! *buf, y, x, DM_COPY);
- need_wrap = decawm;
- continue;
- }
- --- 864,871 ----
-
- if (nextx == cols) {
- sw->con_putc(&vc_cons[currcons],
- ! *buf, y, x, reverse ? DM_INVERSE
- ! : DM_COPY);
- need_wrap = decawm;
- continue;
- }
- ***************
- *** 882,888 ****
- }
-
- sw->con_putcs(&vc_cons[currcons],
- ! buf, count, y, x, DM_COPY);
- if (nextx == cols) {
- x = cols-1;
- need_wrap = decawm;
- --- 884,891 ----
- }
-
- sw->con_putcs(&vc_cons[currcons],
- ! buf, count, y, x, reverse ? DM_INVERSE
- ! : DM_COPY);
- if (nextx == cols) {
- x = cols-1;
- need_wrap = decawm;
- ***************
- *** 910,916 ****
- * 680x0: ignore attributes for now, just
- * print character.
- */
- ! sw->con_putc(&vc_cons[currcons],c,y,x,DM_COPY);
- if (x == video_num_columns - 1)
- need_wrap = decawm;
- else {
- --- 913,920 ----
- * 680x0: ignore attributes for now, just
- * print character.
- */
- ! sw->con_putc(&vc_cons[currcons],c,y,x,
- ! reverse ? DM_INVERSE : DM_COPY);
- if (x == video_num_columns - 1)
- need_wrap = decawm;
- else {
- ***************
- *** 1162,1168 ****
- if (c == '8') {
- /* DEC screen alignment test. kludge :-) */
- video_erase_char =
- ! (video_erase_char & 0x00ff) | 'E';
- /* Arno:
- * Doesn't work, because csi_J(c,2)
- * calls con_clear and doesn't print
- --- 1166,1172 ----
- if (c == '8') {
- /* DEC screen alignment test. kludge :-) */
- video_erase_char =
- ! (video_erase_char & 0xff00) | 'E';
- /* Arno:
- * Doesn't work, because csi_J(c,2)
- * calls con_clear and doesn't print
- ***************
- *** 1170,1176 ****
- */
- csi_J(currcons, 2);
- video_erase_char =
- ! (video_erase_char & 0x00ff) | ' ';
- }
- continue;
- case ESsetG0:
- --- 1174,1180 ----
- */
- csi_J(currcons, 2);
- video_erase_char =
- ! (video_erase_char & 0xff00) | ' ';
- }
- continue;
- case ESsetG0:
- ***************
- *** 1271,1320 ****
- sw->con_putcs(&vc_cons[currcons], start, count ,
- y, x, DM_COPY);
- x += count;
- ! if (x == video_num_columns - 1)
- need_wrap = 1;
- }
-
- set_cursor(currcons);
- }
- -
- - #if 0 /* Arno's old putc based version */
- - void console_print(const char * b)
- - {
- - int currcons = fg_console;
- - unsigned char c;
- -
- - if (!printable || currcons<0 || currcons>=NR_CONSOLES)
- - return;
- - while ((c = *(b++)) != 0) {
- - if (c == 10 || c == 13 || need_wrap) {
- - if (c != 13)
- - lf(currcons);
- - cr(currcons);
- - if (c == 10 || c == 13)
- - continue;
- - }
- - sw->con_putc(&vc_cons[currcons],c,y,x,DM_COPY);
- - if (x == video_num_columns - 1) {
- - need_wrap = 1;
- - continue;
- - }
- - x++;
- - }
- - set_cursor(currcons);
- - return;
- - if (vt_cons[fg_console].vc_mode == KD_GRAPHICS)
- - return;
- - timer_active &= ~(1<<BLANK_TIMER);
- - if (console_blanked) {
- - timer_table[BLANK_TIMER].expires = 0;
- - timer_active |= 1<<BLANK_TIMER;
- - } else if (blankinterval) {
- - timer_table[BLANK_TIMER].expires = jiffies + blankinterval;
- - timer_active |= 1<<BLANK_TIMER;
- - }
- - }
- - #endif
-
-
- /*
- --- 1275,1289 ----
- sw->con_putcs(&vc_cons[currcons], start, count ,
- y, x, DM_COPY);
- x += count;
- ! if (x == video_num_columns)
- ! {
- ! x--;
- need_wrap = 1;
- + }
- }
-
- set_cursor(currcons);
- }
-
-
- /*
- diff -cr --new-file linux-0.9pl1/drivers/char/defkeymap.c.old linux-0.9pl2/drivers/char/defkeymap.c.old
- *** linux-0.9pl1/drivers/char/defkeymap.c.old Tue Jun 7 19:39:16 1994
- --- linux-0.9pl2/drivers/char/defkeymap.c.old Wed Dec 31 19:00:00 1969
- ***************
- *** 1,399 ****
- - /* Automatically generated by mktable */
- - /* Do not edit this file! */
- -
- - #include <linux/types.h>
- - #include <linux/keyboard.h>
- - #include <linux/kd.h>
- -
- - u_short key_map[NR_KEYMAPS][NR_KEYS] = {
- - {
- - 0x0200, 0x001b, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036,
- - 0x0037, 0x0038, 0x0039, 0x0030, 0x002d, 0x003d, 0x007f, 0x0009,
- - 0x0b71, 0x0b77, 0x0b65, 0x0b72, 0x0b74, 0x0b79, 0x0b75, 0x0b69,
- - 0x0b6f, 0x0b70, 0x005b, 0x005d, 0x0201, 0x0702, 0x0b61, 0x0b73,
- - 0x0b64, 0x0b66, 0x0b67, 0x0b68, 0x0b6a, 0x0b6b, 0x0b6c, 0x003b,
- - 0x0027, 0x0060, 0x0700, 0x005c, 0x0b7a, 0x0b78, 0x0b63, 0x0b76,
- - 0x0b62, 0x0b6e, 0x0b6d, 0x002c, 0x002e, 0x002f, 0x0700, 0x030c,
- - 0x0703, 0x0020, 0x0207, 0x0100, 0x0101, 0x0102, 0x0103, 0x0104,
- - 0x0105, 0x0106, 0x0107, 0x0108, 0x0109, 0x0208, 0x0209, 0x0307,
- - 0x0308, 0x0309, 0x030b, 0x0304, 0x0305, 0x0306, 0x030a, 0x0301,
- - 0x0302, 0x0303, 0x0300, 0x0310, 0x0206, 0x0200, 0x003c, 0x010a,
- - 0x010b, 0x0200, 0x0200, 0x0008, 0x0200, 0x0200, 0x0200, 0x0200,
- - 0x030e, 0x0702, 0x030d, 0x001c, 0x0701, 0x0205, 0x0114, 0x0603,
- - 0x0118, 0x0601, 0x0602, 0x0117, 0x0600, 0x0119, 0x0115, 0x0116,
- - 0x011a, 0x010c, 0x010d, 0x011b, 0x011c, 0x0110, 0x0311, 0x011d,
- - 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200,
- - }, {
- - 0x0200, 0x001b, 0x0021, 0x0040, 0x0023, 0x0024, 0x0025, 0x005e,
- - 0x0026, 0x002a, 0x0028, 0x0029, 0x005f, 0x002b, 0x007f, 0x0009,
- - 0x0b51, 0x0b57, 0x0b45, 0x0b52, 0x0b54, 0x0b59, 0x0b55, 0x0b49,
- - 0x0b4f, 0x0b50, 0x007b, 0x007d, 0x0201, 0x0702, 0x0b41, 0x0b53,
- - 0x0b44, 0x0b46, 0x0b47, 0x0b48, 0x0b4a, 0x0b4b, 0x0b4c, 0x003a,
- - 0x0022, 0x007e, 0x0700, 0x007c, 0x0b5a, 0x0b58, 0x0b43, 0x0b56,
- - 0x0b42, 0x0b4e, 0x0b4d, 0x003c, 0x003e, 0x003f, 0x0700, 0x030c,
- - 0x0703, 0x0020, 0x0207, 0x010a, 0x010b, 0x010c, 0x010d, 0x010e,
- - 0x010f, 0x0110, 0x0111, 0x0112, 0x0113, 0x0208, 0x0203, 0x0307,
- - 0x0308, 0x0309, 0x030b, 0x0304, 0x0305, 0x0306, 0x030a, 0x0301,
- - 0x0302, 0x0303, 0x0300, 0x0310, 0x0206, 0x0200, 0x003e, 0x010a,
- - 0x010b, 0x0200, 0x0200, 0x0008, 0x0200, 0x0200, 0x0200, 0x0200,
- - 0x030e, 0x0702, 0x030d, 0x0200, 0x0701, 0x0205, 0x0114, 0x0603,
- - 0x020b, 0x0601, 0x0602, 0x0117, 0x0600, 0x020a, 0x0115, 0x0116,
- - 0x011a, 0x010c, 0x010d, 0x011b, 0x011c, 0x0110, 0x0311, 0x011d,
- - 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200,
- - }, {
- - 0x0200, 0x0200, 0x0200, 0x0040, 0x0200, 0x0024, 0x0200, 0x0200,
- - 0x007b, 0x005b, 0x005d, 0x007d, 0x005c, 0x0200, 0x0200, 0x0200,
- - 0x0b71, 0x0b77, 0x0b65, 0x0b72, 0x0b74, 0x0b79, 0x0b75, 0x0b69,
- - 0x0b6f, 0x0b70, 0x0200, 0x007e, 0x0201, 0x0702, 0x0b61, 0x0b73,
- - 0x0b64, 0x0b66, 0x0b67, 0x0b68, 0x0b6a, 0x0b6b, 0x0b6c, 0x0200,
- - 0x0200, 0x0200, 0x0700, 0x0200, 0x0b7a, 0x0b78, 0x0b63, 0x0b76,
- - 0x0b62, 0x0b6e, 0x0b6d, 0x0200, 0x0200, 0x0200, 0x0700, 0x030c,
- - 0x0703, 0x0200, 0x0207, 0x050c, 0x050d, 0x050e, 0x050f, 0x0510,
- - 0x0511, 0x0512, 0x0513, 0x0514, 0x0515, 0x0208, 0x0202, 0x0307,
- - 0x0308, 0x0309, 0x030b, 0x0304, 0x0305, 0x0306, 0x030a, 0x0301,
- - 0x0302, 0x0303, 0x0300, 0x0310, 0x0206, 0x0200, 0x007c, 0x0516,
- - 0x0517, 0x0200, 0x0200, 0x0008, 0x0200, 0x0200, 0x0200, 0x0200,
- - 0x030e, 0x0702, 0x030d, 0x0200, 0x0701, 0x0205, 0x0114, 0x0603,
- - 0x0118, 0x0601, 0x0602, 0x0117, 0x0600, 0x0119, 0x0115, 0x0116,
- - 0x011a, 0x010c, 0x010d, 0x011b, 0x011c, 0x0110, 0x0311, 0x011d,
- - 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200,
- - }, {
- - 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200,
- - 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200,
- - 0x0b51, 0x0b57, 0x0b45, 0x0b52, 0x0b54, 0x0b59, 0x0b55, 0x0b49,
- - 0x0b4f, 0x0b50, 0x0200, 0x0200, 0x0201, 0x0702, 0x0b41, 0x0b53,
- - 0x0b44, 0x0b46, 0x0b47, 0x0b48, 0x0b4a, 0x0b4b, 0x0b4c, 0x0200,
- - 0x0200, 0x0200, 0x0700, 0x0200, 0x0b5a, 0x0b58, 0x0b43, 0x0b56,
- - 0x0b42, 0x0b4e, 0x0b4d, 0x0200, 0x0200, 0x0200, 0x0700, 0x030c,
- - 0x0703, 0x0200, 0x0207, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200,
- - 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0208, 0x0200, 0x0307,
- - 0x0308, 0x0309, 0x030b, 0x0304, 0x0305, 0x0306, 0x030a, 0x0301,
- - 0x0302, 0x0303, 0x0300, 0x0310, 0x0206, 0x0200, 0x0200, 0x0200,
- - 0x0200, 0x0200, 0x0200, 0x0008, 0x0200, 0x0200, 0x0200, 0x0200,
- - 0x030e, 0x0702, 0x030d, 0x0200, 0x0701, 0x0205, 0x0114, 0x0603,
- - 0x0118, 0x0601, 0x0602, 0x0117, 0x0600, 0x0119, 0x0115, 0x0116,
- - 0x011a, 0x010c, 0x010d, 0x011b, 0x011c, 0x0110, 0x0311, 0x011d,
- - 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200,
- - }, {
- - 0x0200, 0x0200, 0x0200, 0x0000, 0x001b, 0x001c, 0x001d, 0x001e,
- - 0x001f, 0x007f, 0x0200, 0x0200, 0x001f, 0x0200, 0x0200, 0x0200,
- - 0x0011, 0x0017, 0x0005, 0x0012, 0x0014, 0x0019, 0x0015, 0x0009,
- - 0x000f, 0x0010, 0x001b, 0x001d, 0x0201, 0x0702, 0x0001, 0x0013,
- - 0x0004, 0x0006, 0x0007, 0x0008, 0x000a, 0x000b, 0x000c, 0x0200,
- - 0x0007, 0x0000, 0x0700, 0x001c, 0x001a, 0x0018, 0x0003, 0x0016,
- - 0x0002, 0x000e, 0x000d, 0x0200, 0x020e, 0x007f, 0x0700, 0x030c,
- - 0x0703, 0x0000, 0x0207, 0x0100, 0x0101, 0x0102, 0x0103, 0x0104,
- - 0x0105, 0x0106, 0x0107, 0x0108, 0x0109, 0x0208, 0x0204, 0x0307,
- - 0x0308, 0x0309, 0x030b, 0x0304, 0x0305, 0x0306, 0x030a, 0x0301,
- - 0x0302, 0x0303, 0x0300, 0x0310, 0x0206, 0x0200, 0x0200, 0x010a,
- - 0x010b, 0x0200, 0x0200, 0x0008, 0x0200, 0x0200, 0x0200, 0x0200,
- - 0x030e, 0x0702, 0x030d, 0x001c, 0x0701, 0x0205, 0x0114, 0x0603,
- - 0x0118, 0x0601, 0x0602, 0x0117, 0x0600, 0x0119, 0x0115, 0x0116,
- - 0x011a, 0x010c, 0x010d, 0x011b, 0x011c, 0x0110, 0x0311, 0x011d,
- - 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200,
- - }, {
- - 0x0200, 0x0200, 0x0200, 0x0000, 0x0200, 0x0200, 0x0200, 0x0200,
- - 0x0200, 0x0200, 0x0200, 0x0200, 0x001f, 0x0200, 0x0200, 0x0200,
- - 0x0011, 0x0017, 0x0005, 0x0012, 0x0014, 0x0019, 0x0015, 0x0009,
- - 0x000f, 0x0010, 0x0200, 0x0200, 0x0201, 0x0702, 0x0001, 0x0013,
- - 0x0004, 0x0006, 0x0007, 0x0008, 0x000a, 0x000b, 0x000c, 0x0200,
- - 0x0200, 0x0200, 0x0700, 0x0200, 0x001a, 0x0018, 0x0003, 0x0016,
- - 0x0002, 0x000e, 0x000d, 0x0200, 0x0200, 0x0200, 0x0700, 0x030c,
- - 0x0703, 0x0200, 0x0207, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200,
- - 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0208, 0x0200, 0x0307,
- - 0x0308, 0x0309, 0x030b, 0x0304, 0x0305, 0x0306, 0x030a, 0x0301,
- - 0x0302, 0x0303, 0x0300, 0x0310, 0x0206, 0x0200, 0x0200, 0x0200,
- - 0x0200, 0x0200, 0x0200, 0x0008, 0x0200, 0x0200, 0x0200, 0x0200,
- - 0x030e, 0x0702, 0x030d, 0x0200, 0x0701, 0x0205, 0x0114, 0x0603,
- - 0x0118, 0x0601, 0x0602, 0x0117, 0x0600, 0x0119, 0x0115, 0x0116,
- - 0x011a, 0x010c, 0x010d, 0x011b, 0x011c, 0x0110, 0x0311, 0x011d,
- - 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200,
- - }, {
- - 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200,
- - 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200,
- - 0x0011, 0x0017, 0x0005, 0x0012, 0x0014, 0x0019, 0x0015, 0x0009,
- - 0x000f, 0x0010, 0x0200, 0x0200, 0x0201, 0x0702, 0x0001, 0x0013,
- - 0x0004, 0x0006, 0x0007, 0x0008, 0x000a, 0x000b, 0x000c, 0x0200,
- - 0x0200, 0x0200, 0x0700, 0x0200, 0x001a, 0x0018, 0x0003, 0x0016,
- - 0x0002, 0x000e, 0x000d, 0x0200, 0x0200, 0x0200, 0x0700, 0x030c,
- - 0x0703, 0x0200, 0x0207, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200,
- - 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0208, 0x0200, 0x0307,
- - 0x0308, 0x0309, 0x030b, 0x0304, 0x0305, 0x0306, 0x030a, 0x0301,
- - 0x0302, 0x0303, 0x0300, 0x020c, 0x0206, 0x0200, 0x0200, 0x0200,
- - 0x0200, 0x0200, 0x0200, 0x0008, 0x0200, 0x0200, 0x0200, 0x0200,
- - 0x030e, 0x0702, 0x030d, 0x0200, 0x0701, 0x0205, 0x0114, 0x0603,
- - 0x0118, 0x0601, 0x0602, 0x0117, 0x0600, 0x0119, 0x0115, 0x020c,
- - 0x011a, 0x010c, 0x010d, 0x011b, 0x011c, 0x0110, 0x0311, 0x011d,
- - 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200,
- - }, {
- - 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200,
- - 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200,
- - 0x0011, 0x0017, 0x0005, 0x0012, 0x0014, 0x0019, 0x0015, 0x0009,
- - 0x000f, 0x0010, 0x0200, 0x0200, 0x0201, 0x0702, 0x0001, 0x0013,
- - 0x0004, 0x0006, 0x0007, 0x0008, 0x000a, 0x000b, 0x000c, 0x0200,
- - 0x0200, 0x0200, 0x0700, 0x0200, 0x001a, 0x0018, 0x0003, 0x0016,
- - 0x0002, 0x000e, 0x000d, 0x0200, 0x0200, 0x0200, 0x0700, 0x030c,
- - 0x0703, 0x0200, 0x0207, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200,
- - 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0208, 0x0200, 0x0307,
- - 0x0308, 0x0309, 0x030b, 0x0304, 0x0305, 0x0306, 0x030a, 0x0301,
- - 0x0302, 0x0303, 0x0300, 0x0310, 0x0206, 0x0200, 0x0200, 0x0200,
- - 0x0200, 0x0200, 0x0200, 0x0008, 0x0200, 0x0200, 0x0200, 0x0200,
- - 0x030e, 0x0702, 0x030d, 0x0200, 0x0701, 0x0205, 0x0114, 0x0603,
- - 0x0118, 0x0601, 0x0602, 0x0117, 0x0600, 0x0119, 0x0115, 0x0116,
- - 0x011a, 0x010c, 0x010d, 0x011b, 0x011c, 0x0110, 0x0311, 0x011d,
- - 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200,
- - }, {
- - 0x0200, 0x081b, 0x0831, 0x0832, 0x0833, 0x0834, 0x0835, 0x0836,
- - 0x0837, 0x0838, 0x0839, 0x0830, 0x082d, 0x083d, 0x087f, 0x0809,
- - 0x0871, 0x0877, 0x0865, 0x0872, 0x0874, 0x0879, 0x0875, 0x0869,
- - 0x086f, 0x0870, 0x085b, 0x085d, 0x080d, 0x0702, 0x0861, 0x0873,
- - 0x0864, 0x0866, 0x0867, 0x0868, 0x086a, 0x086b, 0x086c, 0x083b,
- - 0x0827, 0x0860, 0x0700, 0x085c, 0x087a, 0x0878, 0x0863, 0x0876,
- - 0x0862, 0x086e, 0x086d, 0x082c, 0x082e, 0x082f, 0x0700, 0x030c,
- - 0x0703, 0x0820, 0x0207, 0x0500, 0x0501, 0x0502, 0x0503, 0x0504,
- - 0x0505, 0x0506, 0x0507, 0x0508, 0x0509, 0x0208, 0x0209, 0x0907,
- - 0x0908, 0x0909, 0x030b, 0x0904, 0x0905, 0x0906, 0x030a, 0x0901,
- - 0x0902, 0x0903, 0x0900, 0x0310, 0x0206, 0x0200, 0x083c, 0x050a,
- - 0x050b, 0x0200, 0x0200, 0x0808, 0x0200, 0x0200, 0x0200, 0x0200,
- - 0x030e, 0x0702, 0x030d, 0x001c, 0x0701, 0x0205, 0x0114, 0x0603,
- - 0x0118, 0x0601, 0x0602, 0x0117, 0x0600, 0x0119, 0x0115, 0x0116,
- - 0x011a, 0x010c, 0x010d, 0x011b, 0x011c, 0x0110, 0x0311, 0x011d,
- - 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200,
- - }, {
- - 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200,
- - 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200,
- - 0x0851, 0x0857, 0x0845, 0x0852, 0x0854, 0x0859, 0x0855, 0x0849,
- - 0x084f, 0x0850, 0x0200, 0x0200, 0x0201, 0x0702, 0x0841, 0x0853,
- - 0x0844, 0x0846, 0x0847, 0x0848, 0x084a, 0x084b, 0x084c, 0x0200,
- - 0x0200, 0x0200, 0x0700, 0x0200, 0x085a, 0x0858, 0x0843, 0x0856,
- - 0x0842, 0x084e, 0x084d, 0x0200, 0x0200, 0x0200, 0x0700, 0x030c,
- - 0x0703, 0x0200, 0x0207, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200,
- - 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0208, 0x0200, 0x0307,
- - 0x0308, 0x0309, 0x030b, 0x0304, 0x0305, 0x0306, 0x030a, 0x0301,
- - 0x0302, 0x0303, 0x0300, 0x0310, 0x0206, 0x0200, 0x0200, 0x0200,
- - 0x0200, 0x0200, 0x0200, 0x0008, 0x0200, 0x0200, 0x0200, 0x0200,
- - 0x030e, 0x0702, 0x030d, 0x0200, 0x0701, 0x0205, 0x0114, 0x0603,
- - 0x0118, 0x0601, 0x0602, 0x0117, 0x0600, 0x0119, 0x0115, 0x0116,
- - 0x011a, 0x010c, 0x010d, 0x011b, 0x011c, 0x0110, 0x0311, 0x011d,
- - 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200,
- - }, {
- - 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200,
- - 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200,
- - 0x0871, 0x0877, 0x0865, 0x0872, 0x0874, 0x0879, 0x0875, 0x0869,
- - 0x086f, 0x0870, 0x0200, 0x0200, 0x0201, 0x0702, 0x0861, 0x0873,
- - 0x0864, 0x0866, 0x0867, 0x0868, 0x086a, 0x086b, 0x086c, 0x0200,
- - 0x0200, 0x0200, 0x0700, 0x0200, 0x087a, 0x0878, 0x0863, 0x0876,
- - 0x0862, 0x086e, 0x086d, 0x0200, 0x0200, 0x0200, 0x0700, 0x030c,
- - 0x0703, 0x0200, 0x0207, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200,
- - 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0208, 0x0200, 0x0307,
- - 0x0308, 0x0309, 0x030b, 0x0304, 0x0305, 0x0306, 0x030a, 0x0301,
- - 0x0302, 0x0303, 0x0300, 0x0310, 0x0206, 0x0200, 0x0200, 0x0200,
- - 0x0200, 0x0200, 0x0200, 0x0008, 0x0200, 0x0200, 0x0200, 0x0200,
- - 0x030e, 0x0702, 0x030d, 0x0200, 0x0701, 0x0205, 0x0114, 0x0603,
- - 0x0118, 0x0601, 0x0602, 0x0117, 0x0600, 0x0119, 0x0115, 0x0116,
- - 0x011a, 0x010c, 0x010d, 0x011b, 0x011c, 0x0110, 0x0311, 0x011d,
- - 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200,
- - }, {
- - 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200,
- - 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200,
- - 0x0851, 0x0857, 0x0845, 0x0852, 0x0854, 0x0859, 0x0855, 0x0849,
- - 0x084f, 0x0850, 0x0200, 0x0200, 0x0201, 0x0702, 0x0841, 0x0853,
- - 0x0844, 0x0846, 0x0847, 0x0848, 0x084a, 0x084b, 0x084c, 0x0200,
- - 0x0200, 0x0200, 0x0700, 0x0200, 0x085a, 0x0858, 0x0843, 0x0856,
- - 0x0842, 0x084e, 0x084d, 0x0200, 0x0200, 0x0200, 0x0700, 0x030c,
- - 0x0703, 0x0200, 0x0207, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200,
- - 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0208, 0x0200, 0x0307,
- - 0x0308, 0x0309, 0x030b, 0x0304, 0x0305, 0x0306, 0x030a, 0x0301,
- - 0x0302, 0x0303, 0x0300, 0x0310, 0x0206, 0x0200, 0x0200, 0x0200,
- - 0x0200, 0x0200, 0x0200, 0x0008, 0x0200, 0x0200, 0x0200, 0x0200,
- - 0x030e, 0x0702, 0x030d, 0x0200, 0x0701, 0x0205, 0x0114, 0x0603,
- - 0x0118, 0x0601, 0x0602, 0x0117, 0x0600, 0x0119, 0x0115, 0x0116,
- - 0x011a, 0x010c, 0x010d, 0x011b, 0x011c, 0x0110, 0x0311, 0x011d,
- - 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200,
- - }, {
- - 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200,
- - 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200,
- - 0x0811, 0x0817, 0x0805, 0x0812, 0x0814, 0x0819, 0x0815, 0x0809,
- - 0x080f, 0x0810, 0x0200, 0x0200, 0x0201, 0x0702, 0x0801, 0x0813,
- - 0x0804, 0x0806, 0x0807, 0x0808, 0x080a, 0x080b, 0x080c, 0x0200,
- - 0x0200, 0x0200, 0x0700, 0x0200, 0x081a, 0x0818, 0x0803, 0x0816,
- - 0x0802, 0x080e, 0x080d, 0x0200, 0x0200, 0x0200, 0x0700, 0x030c,
- - 0x0703, 0x0200, 0x0207, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200,
- - 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0208, 0x0200, 0x0307,
- - 0x0308, 0x0309, 0x030b, 0x0304, 0x0305, 0x0306, 0x030a, 0x0301,
- - 0x0302, 0x0303, 0x0300, 0x020c, 0x0206, 0x0200, 0x0200, 0x0200,
- - 0x0200, 0x0200, 0x0200, 0x0008, 0x0200, 0x0200, 0x0200, 0x0200,
- - 0x030e, 0x0702, 0x030d, 0x0200, 0x0701, 0x0205, 0x0114, 0x0603,
- - 0x0118, 0x0601, 0x0602, 0x0117, 0x0600, 0x0119, 0x0115, 0x020c,
- - 0x011a, 0x010c, 0x010d, 0x011b, 0x011c, 0x0110, 0x0311, 0x011d,
- - 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200,
- - }, {
- - 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200,
- - 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200,
- - 0x0811, 0x0817, 0x0805, 0x0812, 0x0814, 0x0819, 0x0815, 0x0809,
- - 0x080f, 0x0810, 0x0200, 0x0200, 0x0201, 0x0702, 0x0801, 0x0813,
- - 0x0804, 0x0806, 0x0807, 0x0808, 0x080a, 0x080b, 0x080c, 0x0200,
- - 0x0200, 0x0200, 0x0700, 0x0200, 0x081a, 0x0818, 0x0803, 0x0816,
- - 0x0802, 0x080e, 0x080d, 0x0200, 0x0200, 0x0200, 0x0700, 0x030c,
- - 0x0703, 0x0200, 0x0207, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200,
- - 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0208, 0x0200, 0x0307,
- - 0x0308, 0x0309, 0x030b, 0x0304, 0x0305, 0x0306, 0x030a, 0x0301,
- - 0x0302, 0x0303, 0x0300, 0x0310, 0x0206, 0x0200, 0x0200, 0x0200,
- - 0x0200, 0x0200, 0x0200, 0x0008, 0x0200, 0x0200, 0x0200, 0x0200,
- - 0x030e, 0x0702, 0x030d, 0x0200, 0x0701, 0x0205, 0x0114, 0x0603,
- - 0x0118, 0x0601, 0x0602, 0x0117, 0x0600, 0x0119, 0x0115, 0x0116,
- - 0x011a, 0x010c, 0x010d, 0x011b, 0x011c, 0x0110, 0x0311, 0x011d,
- - 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200,
- - }, {
- - 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200,
- - 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200,
- - 0x0811, 0x0817, 0x0805, 0x0812, 0x0814, 0x0819, 0x0815, 0x0809,
- - 0x080f, 0x0810, 0x0200, 0x0200, 0x0201, 0x0702, 0x0801, 0x0813,
- - 0x0804, 0x0806, 0x0807, 0x0808, 0x080a, 0x080b, 0x080c, 0x0200,
- - 0x0200, 0x0200, 0x0700, 0x0200, 0x081a, 0x0818, 0x0803, 0x0816,
- - 0x0802, 0x080e, 0x080d, 0x0200, 0x0200, 0x0200, 0x0700, 0x030c,
- - 0x0703, 0x0200, 0x0207, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200,
- - 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0208, 0x0200, 0x0307,
- - 0x0308, 0x0309, 0x030b, 0x0304, 0x0305, 0x0306, 0x030a, 0x0301,
- - 0x0302, 0x0303, 0x0300, 0x0310, 0x0206, 0x0200, 0x0200, 0x0200,
- - 0x0200, 0x0200, 0x0200, 0x0008, 0x0200, 0x0200, 0x0200, 0x0200,
- - 0x030e, 0x0702, 0x030d, 0x0200, 0x0701, 0x0205, 0x0114, 0x0603,
- - 0x0118, 0x0601, 0x0602, 0x0117, 0x0600, 0x0119, 0x0115, 0x0116,
- - 0x011a, 0x010c, 0x010d, 0x011b, 0x011c, 0x0110, 0x0311, 0x011d,
- - 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200,
- - }, {
- - 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200,
- - 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200,
- - 0x0811, 0x0817, 0x0805, 0x0812, 0x0814, 0x0819, 0x0815, 0x0809,
- - 0x080f, 0x0810, 0x0200, 0x0200, 0x0201, 0x0702, 0x0801, 0x0813,
- - 0x0804, 0x0806, 0x0807, 0x0808, 0x080a, 0x080b, 0x080c, 0x0200,
- - 0x0200, 0x0200, 0x0700, 0x0200, 0x081a, 0x0818, 0x0803, 0x0816,
- - 0x0802, 0x080e, 0x080d, 0x0200, 0x0200, 0x0200, 0x0700, 0x030c,
- - 0x0703, 0x0200, 0x0207, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200,
- - 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0208, 0x0200, 0x0307,
- - 0x0308, 0x0309, 0x030b, 0x0304, 0x0305, 0x0306, 0x030a, 0x0301,
- - 0x0302, 0x0303, 0x0300, 0x0310, 0x0206, 0x0200, 0x0200, 0x0200,
- - 0x0200, 0x0200, 0x0200, 0x0008, 0x0200, 0x0200, 0x0200, 0x0200,
- - 0x030e, 0x0702, 0x030d, 0x0200, 0x0701, 0x0205, 0x0114, 0x0603,
- - 0x0118, 0x0601, 0x0602, 0x0117, 0x0600, 0x0119, 0x0115, 0x0116,
- - 0x011a, 0x010c, 0x010d, 0x011b, 0x011c, 0x0110, 0x0311, 0x011d,
- - 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200, 0x0200,
- - },
- - };
- -
- - char func_buf[FUNC_BUFSIZE] = {
- - '\033', '[', '[', 'A', 0,
- - '\033', '[', '[', 'B', 0,
- - '\033', '[', '[', 'C', 0,
- - '\033', '[', '[', 'D', 0,
- - '\033', '[', '[', 'E', 0,
- - '\033', '[', '1', '7', '~', 0,
- - '\033', '[', '1', '8', '~', 0,
- - '\033', '[', '1', '9', '~', 0,
- - '\033', '[', '2', '0', '~', 0,
- - '\033', '[', '2', '1', '~', 0,
- - '\033', '[', '2', '3', '~', 0,
- - '\033', '[', '2', '4', '~', 0,
- - '\033', '[', '2', '5', '~', 0,
- - '\033', '[', '2', '6', '~', 0,
- - '\033', '[', '2', '8', '~', 0,
- - '\033', '[', '2', '9', '~', 0,
- - '\033', '[', '3', '1', '~', 0,
- - '\033', '[', '3', '2', '~', 0,
- - '\033', '[', '3', '3', '~', 0,
- - '\033', '[', '3', '4', '~', 0,
- - '\033', '[', '1', '~', 0,
- - '\033', '[', '2', '~', 0,
- - '\033', '[', '3', '~', 0,
- - '\033', '[', '4', '~', 0,
- - '\033', '[', '5', '~', 0,
- - '\033', '[', '6', '~', 0,
- - '\033', '[', 'M', 0,
- - 0,
- - 0,
- - '\033', '[', 'P', 0,
- - 0,
- - 0,
- - 0,
- - 0,
- - 0,
- - 0,
- - };
- -
- - char *func_table[NR_FUNC] = {
- - func_buf + 0,
- - func_buf + 5,
- - func_buf + 10,
- - func_buf + 15,
- - func_buf + 20,
- - func_buf + 25,
- - func_buf + 31,
- - func_buf + 37,
- - func_buf + 43,
- - func_buf + 49,
- - func_buf + 55,
- - func_buf + 61,
- - func_buf + 67,
- - func_buf + 73,
- - func_buf + 79,
- - func_buf + 85,
- - func_buf + 91,
- - func_buf + 97,
- - func_buf + 103,
- - func_buf + 109,
- - func_buf + 115,
- - func_buf + 120,
- - func_buf + 125,
- - func_buf + 130,
- - func_buf + 135,
- - func_buf + 140,
- - func_buf + 145,
- - func_buf + 149,
- - func_buf + 150,
- - func_buf + 151,
- - func_buf + 155,
- - func_buf + 156,
- - func_buf + 157,
- - func_buf + 158,
- - func_buf + 159,
- - func_buf + 160,
- - };
- -
- - struct kbdiacr accent_table[MAX_DIACR] = {
- - {'`', 'A', '\300'}, {'`', 'a', '\340'},
- - {'\'', 'A', '\301'}, {'\'', 'a', '\341'},
- - {'^', 'A', '\302'}, {'^', 'a', '\342'},
- - {'~', 'A', '\303'}, {'~', 'a', '\343'},
- - {'"', 'A', '\304'}, {'"', 'a', '\344'},
- - {'O', 'A', '\305'}, {'o', 'a', '\345'},
- - {'0', 'A', '\305'}, {'0', 'a', '\345'},
- - {'A', 'A', '\305'}, {'a', 'a', '\345'},
- - {'A', 'E', '\306'}, {'a', 'e', '\346'},
- - {',', 'C', '\307'}, {',', 'c', '\347'},
- - {'`', 'E', '\310'}, {'`', 'e', '\350'},
- - {'\'', 'E', '\311'}, {'\'', 'e', '\351'},
- - {'^', 'E', '\312'}, {'^', 'e', '\352'},
- - {'"', 'E', '\313'}, {'"', 'e', '\353'},
- - {'`', 'I', '\314'}, {'`', 'i', '\354'},
- - {'\'', 'I', '\315'}, {'\'', 'i', '\355'},
- - {'^', 'I', '\316'}, {'^', 'i', '\356'},
- - {'"', 'I', '\317'}, {'"', 'i', '\357'},
- - {'-', 'D', '\320'}, {'-', 'd', '\360'},
- - {'~', 'N', '\321'}, {'~', 'n', '\361'},
- - {'`', 'O', '\322'}, {'`', 'o', '\362'},
- - {'\'', 'O', '\323'}, {'\'', 'o', '\363'},
- - {'^', 'O', '\324'}, {'^', 'o', '\364'},
- - {'~', 'O', '\325'}, {'~', 'o', '\365'},
- - {'"', 'O', '\326'}, {'"', 'o', '\366'},
- - {'/', 'O', '\330'}, {'/', 'o', '\370'},
- - {'`', 'U', '\331'}, {'`', 'u', '\371'},
- - {'\'', 'U', '\332'}, {'\'', 'u', '\372'},
- - {'^', 'U', '\333'}, {'^', 'u', '\373'},
- - {'"', 'U', '\334'}, {'"', 'u', '\374'},
- - {'\'', 'Y', '\335'}, {'\'', 'y', '\375'},
- - {'T', 'H', '\336'}, {'t', 'h', '\376'},
- - {'s', 's', '\337'}, {'"', 'y', '\377'},
- - {'s', 'z', '\337'}, {'i', 'j', '\377'},
- - };
- -
- - unsigned int accent_table_size = 68;
- --- 0 ----
- diff -cr --new-file linux-0.9pl1/drivers/char/lp.c linux-0.9pl2/drivers/char/lp.c
- *** linux-0.9pl1/drivers/char/lp.c Tue Jun 7 19:39:17 1994
- --- linux-0.9pl2/drivers/char/lp.c Sat Aug 6 19:51:24 1994
- ***************
- *** 1,5 ****
- --- 1,6 ----
- /*
- * Amiga printer device by Michael Rausch (linux@uni-koblenz.de);
- + * Atari support added by Andreas Schwab (schwab@ls5.informatik.uni-dortmund.de);
- * based upon work from
- *
- * Copyright (C) 1992 by Jim Weigand and Linus Torvalds
- ***************
- *** 9,18 ****
- --- 10,32 ----
- * Copyright (C) 1993 by Nigel Gamble (added interrupt code)
- */
-
- + #include <linux/config.h>
- #include <linux/errno.h>
- #include <linux/kernel.h>
- #include <linux/major.h>
- #include <linux/sched.h>
- +
- + #ifdef CONFIG_AMIGA
- + #include <linux/amigahw.h>
- + #include <linux/amigaints.h>
- + #endif
- +
- + #ifdef CONFIG_ATARI
- + #include <linux/delay.h>
- + #include <linux/atarihw.h>
- + #include <linux/atariints.h>
- + #endif
- +
- #include <linux/lp.h>
- #include <linux/malloc.h>
- #include <linux/interrupt.h>
- ***************
- *** 20,27 ****
- #include <asm/segment.h>
- #include <asm/system.h>
-
- - #include <linux/amigahw.h>
- - #include <linux/amigaints.h>
-
- /*
- * why bother around with the pio driver when the interrupt works;
- --- 34,39 ----
- ***************
- *** 55,61 ****
- count ++;
- if(need_resched)
- schedule();
- ! } while(LP_IS_BUSY && count < LP_CHAR);
-
- if (count == LP_CHAR) {
- return 0;
- --- 67,73 ----
- count ++;
- if(need_resched)
- schedule();
- ! } while(LP_IS_BUSY() && count < LP_CHAR);
-
- if (count == LP_CHAR) {
- return 0;
- ***************
- *** 82,88 ****
- #if WHICH_DRIVER != FORCE_POLLING
- static int lp_char_interrupt(char lpchar)
- {
- ! if (!LP_IS_BUSY) {
- LP_OUT(lpchar);
- return 1;
- }
- --- 94,100 ----
- #if WHICH_DRIVER != FORCE_POLLING
- static int lp_char_interrupt(char lpchar)
- {
- ! if (!LP_IS_BUSY()) {
- LP_OUT(lpchar);
- return 1;
- }
- ***************
- *** 159,173 ****
- if(copy_size) {
- int rc = total_bytes_written + bytes_written;
-
- ! if (LP_HAS_POUT) {
- printk("lp0: out of paper\n");
- if (!rc)
- rc = -ENOSPC;
- ! } else if (!LP_IS_ONLINE) {
- printk("lp0: off-line\n");
- if (!rc)
- rc = -EIO;
- ! } else if (LP_IS_BUSY) {
- printk("lp0: printer error\n");
- if (!rc)
- rc = -EIO;
- --- 171,185 ----
- if(copy_size) {
- int rc = total_bytes_written + bytes_written;
-
- ! if (LP_HAS_POUT()) {
- printk("lp0: out of paper\n");
- if (!rc)
- rc = -ENOSPC;
- ! } else if (!LP_IS_ONLINE()) {
- printk("lp0: off-line\n");
- if (!rc)
- rc = -EIO;
- ! } else if (LP_IS_BUSY()) {
- printk("lp0: printer error\n");
- if (!rc)
- rc = -EIO;
- ***************
- *** 227,233 ****
- lp_total_chars++;
- #endif
- } else { /* if printer timed out */
- ! if (LP_HAS_POUT) {
- printk("lp0: out of paper\n");
- if(LP_F & LP_ABORT)
- return temp-buf?temp-buf:-ENOSPC;
- --- 239,245 ----
- lp_total_chars++;
- #endif
- } else { /* if printer timed out */
- ! if (LP_HAS_POUT()) {
- printk("lp0: out of paper\n");
- if(LP_F & LP_ABORT)
- return temp-buf?temp-buf:-ENOSPC;
- ***************
- *** 235,241 ****
- current->timeout = jiffies + LP_TIMEOUT_POLLED;
- schedule();
- } else
- ! if (!LP_IS_ONLINE) {
- printk("lp0: off-line\n");
- if(LP_F & LP_ABORT)
- return temp-buf?temp-buf:-EIO;
- --- 247,253 ----
- current->timeout = jiffies + LP_TIMEOUT_POLLED;
- schedule();
- } else
- ! if (!LP_IS_ONLINE()) {
- printk("lp0: off-line\n");
- if(LP_F & LP_ABORT)
- return temp-buf?temp-buf:-EIO;
- ***************
- *** 244,250 ****
- schedule();
- } else
- /* not offline or out of paper. on fire? */
- ! if (LP_IS_BUSY) {
- printk("lp0: on fire\n");
- if(LP_F & LP_ABORT)
- return temp-buf?temp-buf:-EFAULT;
- --- 256,262 ----
- schedule();
- } else
- /* not offline or out of paper. on fire? */
- ! if (LP_IS_BUSY()) {
- printk("lp0: on fire\n");
- if(LP_F & LP_ABORT)
- return temp-buf?temp-buf:-EFAULT;
- ***************
- *** 302,309 ****
-
- LP_F |= LP_BUSY;
-
- ! ciaa.ddrb = 0xff; /* set the correct data directions */
- ! ciab.ddra &= 0xf8; /* maybe changed in some plip code */
-
- return 0;
- }
- --- 314,337 ----
-
- LP_F |= LP_BUSY;
-
- ! #ifdef CONFIG_AMIGA
- ! if (boot_info.machtype == MACH_AMIGA)
- ! {
- ! ciaa.ddrb = 0xff; /* set the correct data directions */
- ! ciab.ddra &= 0xf8; /* maybe changed in some plip code */
- ! }
- ! #endif
- !
- ! #ifdef CONFIG_ATARI
- ! if (boot_info.machtype == MACH_ATARI)
- ! {
- ! /* Setup IO ports as output */
- ! cli ();
- ! sound_ym.rd_data_reg_sel = 7;
- ! sound_ym.wd_data = (sound_ym.rd_data_reg_sel & 0x3f) | 0xc0;
- ! sti ();
- ! }
- ! #endif
-
- return 0;
- }
- ***************
- *** 375,385 ****
- printk("lp_init: lp0 using polling driver\n");
- #else
-
- ! if((lp_table.irq = mach_add_isr(IRQ_AMIGA_CIAA_FLG, (isrfunc)lp_interrupt, 0, NULL)))
- {
- lp_table.lp_buffer = (char*)kmem_start;
- kmem_start += LP_BUFFER_SIZE;
- ! printk("lp_init: lp0 using cia interrupt\n");
- }
- else
-
- --- 403,422 ----
- printk("lp_init: lp0 using polling driver\n");
- #else
-
- ! #ifdef CONFIG_AMIGA
- ! if (boot_info.machtype == MACH_AMIGA)
- ! lp_table.irq = mach_add_isr(IRQ_AMIGA_CIAA_FLG, (isrfunc)lp_interrupt, 0, NULL);
- ! #endif
- ! #ifdef CONFIG_ATARI
- ! if (boot_info.machtype == MACH_ATARI)
- ! lp_table.irq = mach_add_isr (IRQ_MFP_BUSY, (isrfunc) lp_interrupt, 0, NULL);
- ! #endif
- !
- ! if (lp_table.irq)
- {
- lp_table.lp_buffer = (char*)kmem_start;
- kmem_start += LP_BUFFER_SIZE;
- ! printk("lp_init: lp0 using interrupt\n");
- }
- else
-
- ***************
- *** 387,396 ****
- printk("lp_init: lp0 using polling driver\n");
- #else
- {
- ! printk("cannot get cia interrupt for lp0, and polling driver not configured.\n");
- return kmem_start;
- }
- #endif
- #endif
-
- LP_F |= LP_EXIST;
- --- 424,439 ----
- printk("lp_init: lp0 using polling driver\n");
- #else
- {
- ! printk("cannot get interrupt for lp0, and polling driver not configured.\n");
- return kmem_start;
- }
- #endif
- + #endif
- +
- + #ifdef CONFIG_ATARI
- + if (boot_info.machtype == MACH_ATARI)
- + /* Enable interrupts */
- + mfp.int_en_b |= 1;
- #endif
-
- LP_F |= LP_EXIST;
- diff -cr --new-file linux-0.9pl1/drivers/char/mem.c linux-0.9pl2/drivers/char/mem.c
- *** linux-0.9pl1/drivers/char/mem.c Tue Jun 7 19:39:17 1994
- --- linux-0.9pl2/drivers/char/mem.c Fri Aug 5 12:46:55 1994
- ***************
- *** 394,400 ****
- #endif
- #if defined (CONFIG_BUSMOUSE) || defined (CONFIG_82C710_MOUSE) || \
- defined (CONFIG_PSMOUSE) || defined (CONFIG_MS_BUSMOUSE) || \
- ! defined (CONFIG_ATIXL_BUSMOUSE) || defined (CONFIG_AMIGAMOUSE)
- mem_start = mouse_init(mem_start);
- #endif
- /*
- --- 394,401 ----
- #endif
- #if defined (CONFIG_BUSMOUSE) || defined (CONFIG_82C710_MOUSE) || \
- defined (CONFIG_PSMOUSE) || defined (CONFIG_MS_BUSMOUSE) || \
- ! defined (CONFIG_ATIXL_BUSMOUSE) || defined (CONFIG_AMIGAMOUSE) || \
- ! defined (CONFIG_ATARIMOUSE)
- mem_start = mouse_init(mem_start);
- #endif
- /*
- diff -cr --new-file linux-0.9pl1/drivers/char/serial.c linux-0.9pl2/drivers/char/serial.c
- *** linux-0.9pl1/drivers/char/serial.c Tue Jun 7 19:39:19 1994
- --- linux-0.9pl2/drivers/char/serial.c Sun Aug 7 12:05:49 1994
- ***************
- *** 1,18 ****
- #include <linux/types.h>
- ! #include <linux/fs.h>
- ! #include <linux/tty.h>
- #include <linux/errno.h>
-
- ! struct file;
- ! struct tty_struct;
-
- - int rs_open(struct tty_struct *tty, struct file * filp)
- {
- ! return -EIO;
- }
-
- ! long rs_init(long kmem_start)
- {
- ! return kmem_start;
- }
-
- --- 1,1002 ----
- +
- + /*
- + * drivers/char/serial.c: Common source file for Linux/68k serial drivers
- + *
- + * Copyright 1994 Roman Hodek
- + * EMail: rnhodek@cip.informatik.uni-erlangen.de (Internet)
- + * or: Roman_Hodek@n.maus.de (MausNet, NO mail > 16 KB!)
- + *
- + * Partially based on PC-Linux serial.c by Linus Torvalds and Theodore Ts'o
- + *
- + * This file is subject to the terms and conditions of the GNU General Public
- + * License. See the file README.legal in the main directory of this archive
- + * for more details.
- + *
- + */
- +
- + /*
- + * Notes and Design Goals:
- + * -----------------------
- + * The PC serial drivers can rely on the fact that all the serial
- + * hardware is very similar to program for all ports. Unfortunately,
- + * this is not true for the Atari. Here it is nearly the other way
- + * round: All ports need different treatment for the low-level stuff.
- + *
- + * For this reason, I split the serial driver code into a
- + * port-independent part (atari_serial.c) and port-specific parts
- + * (atari_*.c). The first manages all what can be done without
- + * accessing the hardware directly, i.e. interfacing with the
- + * high-level tty drivers, wait queues, managing the existing ports
- + * and the like. The latter do the actual hardware programming and are
- + * accessed by the hardware-independant part by a "switch" structure,
- + * that contains pointers to functions for specific tasks. See the
- + * comment before the definition of the SERIALSWITCH structure in
- + * atari_serial.h for more details.
- + *
- + * Despite its name, the port-independant code should be usable by
- + * other machines than Atari, too, if there are similar circumstances
- + * with different serial port hardware. Feel free to use it, but
- + * please inform me if you have to do changes to it. I'll try to keep
- + * it really device-independant.
- + *
- + * Note: Hamish Macdonald, August 1994.
- + * Modified to support the Amiga serial port also. Files were renamed
- + * to "serial.c" and "serial.h" at that time.
- + *
- + */
- +
- +
- + #include <linux/config.h>
- #include <linux/types.h>
- ! #include <linux/sched.h>
- ! #include <linux/timer.h>
- #include <linux/errno.h>
- + #include <linux/string.h>
- + #include <linux/bootinfo.h>
- + #include <linux/tty.h>
- + #include <linux/termios.h>
- + #include <linux/major.h>
- + #include <linux/fcntl.h>
- +
- + #include <asm/bitops.h>
- + #include <asm/segment.h>
- +
- + #include "serial.h"
- +
- + #ifdef CONFIG_ATARI
- + #include "atari_SCC.h"
- + #include "atari_MFPser.h"
- + #endif
- +
- + #ifdef CONFIG_AMIGA
- + void amiga_serinit ( struct async_struct * );
- + #endif
- +
- +
- + struct async_struct rs_table[ NR_PORTS ];
- + char rs_event[ (NR_PORTS + 7) / 8 ];
- +
- +
- + /***************************** Prototypes *****************************/
- +
- + static inline void handle_rs_break( struct async_struct *info );
- + static void do_softint( void *unused );
- + static int startup( struct async_struct * info, int get_irq );
- + static void shutdown( struct async_struct * info, int do_free_irq );
- + static int get_serial_info( struct async_struct * info, struct
- + serial_struct * retinfo );
- + static int set_serial_info( struct async_struct * info, struct
- + serial_struct * new_info );
- + static int get_modem_info( struct async_struct * info, unsigned int *value
- + );
- + static int set_modem_info( struct async_struct * info, unsigned int cmd,
- + unsigned int *value );
- + static void send_break( struct async_struct * info, int duration );
- + static int rs_ioctl( struct tty_struct *tty, struct file * file, unsigned
- + int cmd, unsigned long arg );
- + static void rs_set_termios( struct tty_struct *tty, struct termios
- + *old_termios );
- + static void rs_close( struct tty_struct *tty, struct file * filp );
- + static int block_til_ready( struct tty_struct *tty, struct file * filp,
- + struct async_struct *info );
- +
- + /************************* End of Prototypes **************************/
- +
- +
- +
- + /*
- + * ------------------------------------------------------------
- + * rs_stop() and rs_start()
- + *
- + * This routines are called before setting or resetting tty->stopped.
- + * They enable or disable transmitter interrupts, as necessary.
- + * ------------------------------------------------------------ */
- +
- + void rs_stop( struct tty_struct *tty )
- + {
- + struct async_struct *info;
- +
- + info = rs_table + DEV_TO_SL(tty->line);
- +
- + if (info->flags & ASYNC_CLOSING) {
- + tty->stopped = 0;
- + tty->hw_stopped = 0;
- + return;
- + }
- +
- + if (info->sw->enab_tx_int)
- + info->sw->enab_tx_int( info, 0 );
- + }
- +
- + void rs_start( struct tty_struct *tty )
- + {
- + struct async_struct *info;
- +
- + info = rs_table + DEV_TO_SL(tty->line);
- +
- + if (info->sw->enab_tx_int) {
- + info->sw->enab_tx_int( info, 1 );
- + }
- + }
- +
- +
- + /*
- + * This routine is called when we receive a break on a serial line.
- + * It is executed out of the software interrupt routine.
- + */
- +
- + static inline void handle_rs_break( struct async_struct *info )
- +
- + {
- + if (info->flags & ASYNC_SAK)
- + do_SAK(info->tty);
- +
- + if (!I_IGNBRK(info->tty) && I_BRKINT(info->tty)) {
- + flush_input(info->tty);
- + flush_output(info->tty);
- + if (info->tty->pgrp > 0)
- + kill_pg(info->tty->pgrp, SIGINT, 1 );
- + }
- + }
- +
- + /*
- + * This routine is used to handle the "bottom half" processing for the
- + * serial driver, known also the "software interrupt" processing.
- + * This processing is done at the kernel interrupt level, after the
- + * rs_interrupt() has returned, BUT WITH INTERRUPTS TURNED ON. This
- + * is where time-consuming activities which can not be done in the
- + * interrupt driver proper are done; the interrupt driver schedules
- + * them using rs_sched_event(), and they get done here.
- + */
- + static void do_softint( void *unused )
- +
- + {
- + int i;
- + struct async_struct *info;
- +
- + for (i = 0, info = rs_table; i < NR_PORTS; i++,info++) {
- + if (clear_bit(i, rs_event)) {
- + if (!info->tty)
- + continue;
- + if (clear_bit(RS_EVENT_READ_PROCESS, &info->event)) {
- + TTY_READ_FLUSH(info->tty);
- + }
- + if (clear_bit(RS_EVENT_WRITE_WAKEUP, &info->event)) {
- + wake_up_interruptible(&info->tty->write_q.proc_list);
- + }
- + if (clear_bit(RS_EVENT_HANGUP, &info->event)) {
- + tty_hangup(info->tty);
- + wake_up_interruptible(&info->open_wait);
- + info->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CALLOUT_ACTIVE);
- + }
- + if (clear_bit(RS_EVENT_BREAK, &info->event))
- + handle_rs_break(info);
- + if (clear_bit(RS_EVENT_OPEN_WAKEUP, &info->event)) {
- + wake_up_interruptible(&info->open_wait);
- + }
- + }
- + }
- + }
- +
- + static int startup( struct async_struct * info, int get_irq )
- +
- + {
- + unsigned long flags;
- +
- + if (info->flags & ASYNC_INITIALIZED)
- + return 0;
- +
- + if (!info->base || !info->type) {
- + if (info->tty)
- + set_bit(TTY_IO_ERROR, &info->tty->flags);
- + return 0;
- + }
- +
- + save_flags(flags); cli();
- +
- + #ifdef SERIAL_DEBUG_OPEN
- + printk("starting up ttyS%d ...", info->line);
- + #endif
- +
- + info->sw->init( info );
- +
- + if (info->tty)
- + clear_bit(TTY_IO_ERROR, &info->tty->flags);
- +
- + /*
- + * Set the speed and other port parameters.
- + */
- + info->sw->change_speed( info );
- +
- + info->flags |= ASYNC_INITIALIZED;
- + restore_flags(flags);
- + return 0;
- + }
- +
- + /*
- + * This routine will shutdown a serial port; interrupts are disabled, and
- + * DTR is dropped if the hangup on close termio flag is on.
- + */
- +
- + static void shutdown( struct async_struct * info, int do_free_irq )
- +
- + {
- + unsigned long flags;
- +
- + if (!(info->flags & ASYNC_INITIALIZED))
- + return;
- +
- + #ifdef SERIAL_DEBUG_OPEN
- + printk("Shutting down serial port %d ....", info->line);
- + #endif
- +
- + save_flags(flags); cli(); /* Disable interrupts */
- +
- + info->sw->deinit( info, info->tty &&
- + !(info->tty->termios->c_cflag & HUPCL) );
- +
- + if (info->tty)
- + set_bit(TTY_IO_ERROR, &info->tty->flags);
- +
- + info->flags &= ~ASYNC_INITIALIZED;
- + restore_flags(flags);
- + }
- +
- +
- + /*
- + * ------------------------------------------------------------
- + * rs_write() and friends
- + * ------------------------------------------------------------
- + */
- +
- + /*
- + * This routine gets called when tty_write has put something into
- + * the write_queue.
- + */
- +
- + void rs_write( struct tty_struct * tty )
- +
- + { struct async_struct *info;
- +
- + if (!tty || tty->stopped || tty->hw_stopped)
- + return;
- + info = rs_table + DEV_TO_SL(tty->line);
- +
- + cli();
- + if (!info || !info->tty || !(info->flags & ASYNC_INITIALIZED)) {
- + sti();
- + return;
- + }
- +
- + if (info->sw->enab_tx_int)
- + info->sw->enab_tx_int( info, 1 );
- + info->sw->restart( info );
- + sti();
- + }
- +
- +
- + /*
- + * ------------------------------------------------------------
- + * rs_throttle()
- + *
- + * This routine is called by the upper-layer tty layer to signal that
- + * incoming characters should be throttled (and that the throttle
- + * should be released).
- + * ------------------------------------------------------------
- + */
- +
- + void rs_throttle( struct tty_struct * tty, int status )
- +
- + {
- + struct async_struct *info;
- + unsigned long flags;
- +
- + save_flags(flags); cli();
- + #if SERIAL_DEBUG_THROTTLE
- + printk("throttle tty%d: %d (%d, %d)....\n", DEV_TO_SL(tty->line),
- + status, LEFT(&tty->read_q), LEFT(&tty->secondary));
- + #endif
- +
- + switch( status ) {
- +
- + case TTY_THROTTLE_RQ_FULL:
- + info = rs_table + DEV_TO_SL(tty->line);
- + if (I_IXOFF(tty))
- + info->x_char = STOP_CHAR(tty);
- + else if (C_CRTSCTS(tty))
- + info->sw->throttle( info, status );
- + break;
- +
- + case TTY_THROTTLE_RQ_AVAIL:
- + info = rs_table + DEV_TO_SL(tty->line);
- + if (I_IXOFF(tty)) {
- + if (info->x_char)
- + info->x_char = 0;
- + else
- + info->x_char = START_CHAR(tty);
- + } else if (C_CRTSCTS(tty))
- + info->sw->throttle( info, status );
- + break;
- + }
- +
- + restore_flags(flags);
- + }
- +
- + /*
- + * ------------------------------------------------------------
- + * rs_ioctl() and friends
- + * ------------------------------------------------------------
- + */
- +
- + static int get_serial_info (struct async_struct * info,
- + struct serial_struct * retinfo )
- + {
- + struct serial_struct tmp;
- +
- + if (!retinfo)
- + return -EFAULT;
- +
- + /* Set port-independant data */
- + memset(&tmp, 0, sizeof(tmp));
- + tmp.type = info->type;
- + tmp.line = info->line;
- + tmp.port = 0; /* meaningless for non-Intel */
- + tmp.irq = 0; /* meaningless for Atari */
- + tmp.flags = info->flags;
- + tmp.close_delay = info->close_delay;
- + tmp.hub6 = 0; /* meaningless for Atari */
- +
- + /* At least baud_base and costum_divisor set by port-specific
- + * function
- + */
- + info->sw->get_serial_info( info, &tmp );
- +
- + memcpy_tofs( retinfo, &tmp, sizeof(*retinfo) );
- + return 0;
- + }
- +
-
- ! static int set_serial_info( struct async_struct * info,
- ! struct serial_struct * new_info )
-
- {
- ! struct serial_struct new_serial;
- ! struct async_struct old_info;
- !
- ! if (!new_info) return( -EFAULT );
- ! memcpy_fromfs( &new_serial, new_info, sizeof(new_serial) );
- ! old_info = *info;
- !
- ! /* The fields type, line, port, irq, xmit_fifo_size, baud_base and
- ! * hub6 of new_info are silently ignored for the Atari, since they
- ! * are meaningless or cannot be changed, resp. Is this right or
- ! * should an error be returned?
- ! */
- !
- ! /* If a new custom divisor is to be set, let it check by the
- ! * hardware specific code first!
- ! */
- ! if (new_serial.custom_divisor != info->custom_divisor) {
- ! if (info->sw->check_custom_divisor( info, new_serial.custom_divisor ))
- ! return( -EINVAL );
- ! }
- !
- ! if (!suser()) {
- ! if ((new_serial.close_delay != info->close_delay) ||
- ! ((new_serial.flags & ~ASYNC_USR_MASK) !=
- ! (info->flags & ~ASYNC_USR_MASK))) return( -EPERM );
- !
- ! info->flags = ((info->flags & ~ASYNC_USR_MASK) |
- ! (new_serial.flags & ASYNC_USR_MASK));
- ! info->custom_divisor = new_serial.custom_divisor;
- ! goto check_and_exit;
- ! }
- !
- ! /*
- ! * OK, past this point, all the error checking has been done.
- ! * At this point, we start making changes.....
- ! */
- !
- ! info->flags = ((info->flags & ~ASYNC_FLAGS) |
- ! (new_serial.flags & ASYNC_FLAGS));
- ! info->custom_divisor = new_serial.custom_divisor;
- ! info->close_delay = new_serial.close_delay;
- !
- ! check_and_exit:
- ! if (info->flags & ASYNC_INITIALIZED) {
- !
- ! if (((old_info.flags & ASYNC_SPD_MASK) !=
- ! (info->flags & ASYNC_SPD_MASK)) ||
- ! (old_info.custom_divisor != info->custom_divisor))
- ! info->sw->change_speed( info );
- ! }
- ! else
- ! (void)startup( info, 0 );
- !
- ! return 0;
- ! }
- !
- ! static int get_modem_info (struct async_struct * info,
- ! unsigned int *value )
- ! {
- ! unsigned int result;
- !
- ! result = info->sw->get_modem_info( info );
- ! put_fs_long( result, (unsigned long *) value );
- !
- ! return 0;
- ! }
- !
- !
- ! static int set_modem_info (struct async_struct * info, unsigned int cmd,
- ! unsigned int *value)
- ! {
- ! unsigned arg = get_fs_long((unsigned long *) value);
- ! int new_dtr = -1, new_rts = -1;
- !
- ! switch( cmd ) {
- ! case TIOCMBIS:
- ! if (arg & TIOCM_DTR) new_dtr = 1;
- ! if (arg & TIOCM_RTS) new_rts = 1;
- ! break;
- !
- ! case TIOCMBIC:
- ! if (arg & TIOCM_DTR) new_dtr = 0;
- ! if (arg & TIOCM_RTS) new_rts = 0;
- ! break;
- !
- ! case TIOCMSET:
- ! new_dtr = !!(arg & TIOCM_DTR);
- ! new_rts = !!(arg & TIOCM_RTS);
- ! break;
- !
- ! default:
- ! return( -EINVAL );
- ! }
- !
- ! return( info->sw->set_modem_info( info, new_dtr, new_rts ) );
- ! }
- !
- !
- ! /*
- ! * This routine sends a break out the serial port.
- ! */
- !
- ! static void send_break( struct async_struct * info, int duration )
- !
- ! {
- ! if (!info->base) return;
- !
- ! current->state = TASK_INTERRUPTIBLE;
- ! current->timeout = jiffies + duration;
- ! cli();
- ! info->sw->set_break( info, 1 );
- ! schedule();
- ! info->sw->set_break( info, 0 );
- ! sti();
- }
-
- ! static int rs_ioctl( struct tty_struct *tty, struct file * file,
- ! unsigned int cmd, unsigned long arg )
- !
- {
- ! int error, line;
- ! struct async_struct * info;
- !
- ! line = DEV_TO_SL(tty->line);
- ! if (line < 0 || line >= NR_PORTS)
- ! return -ENODEV;
- ! info = rs_table + line;
- ! if (!info->base) return( -ENODEV );
- !
- ! switch( cmd ) {
- ! case TCSBRK: /* SVID version: non-zero arg --> no break */
- ! if (!arg)
- ! send_break(info, HZ/4); /* 1/4 second */
- ! return 0;
- ! case TCSBRKP: /* support for POSIX tcsendbreak() */
- ! send_break(info, arg ? arg*(HZ/10) : HZ/4);
- ! return 0;
- ! case TIOCGSOFTCAR:
- ! error = verify_area(VERIFY_WRITE, (void *) arg,sizeof(long));
- ! if (error)
- ! return error;
- ! put_fs_long(C_CLOCAL(tty) ? 1 : 0, (unsigned long *) arg);
- ! return 0;
- ! case TIOCSSOFTCAR:
- ! arg = get_fs_long((unsigned long *) arg);
- ! tty->termios->c_cflag =
- ! ((tty->termios->c_cflag & ~CLOCAL) | (arg ? CLOCAL : 0));
- ! return 0;
- ! case TIOCMGET:
- ! error = verify_area(VERIFY_WRITE, (void *) arg,
- ! sizeof(unsigned int));
- ! if (error)
- ! return error;
- ! return get_modem_info(info, (unsigned int *) arg);
- ! case TIOCMBIS:
- ! case TIOCMBIC:
- ! case TIOCMSET:
- ! return set_modem_info(info, cmd, (unsigned int *) arg);
- ! case TIOCGSERIAL:
- ! error = verify_area(VERIFY_WRITE, (void *) arg,
- ! sizeof(struct serial_struct));
- ! if (error)
- ! return error;
- ! return get_serial_info(info, (struct serial_struct *) arg);
- ! case TIOCSSERIAL:
- ! return set_serial_info(info, (struct serial_struct *) arg);
- ! case TIOCSERCONFIG:
- ! /* return do_autoconfig(info); */
- ! return( 0 );
- !
- ! default:
- ! if (info->sw->ioctl)
- ! return( info->sw->ioctl( tty, file, info, cmd, arg ) );
- ! else
- ! return( -EINVAL );
- ! }
- ! return 0;
- }
-
- +
- + static void rs_set_termios( struct tty_struct *tty,
- + struct termios *old_termios )
- +
- + {
- + struct async_struct *info;
- +
- + if (tty->termios->c_cflag == old_termios->c_cflag)
- + return;
- +
- + info = &rs_table[DEV_TO_SL(tty->line)];
- +
- + info->sw->change_speed( info );
- +
- + if ((old_termios->c_cflag & CRTSCTS) &&
- + !(tty->termios->c_cflag & CRTSCTS)) {
- + tty->hw_stopped = 0;
- + rs_write(tty);
- + }
- +
- + if (!(old_termios->c_cflag & CLOCAL) &&
- + (tty->termios->c_cflag & CLOCAL))
- + wake_up_interruptible(&info->open_wait);
- + }
- +
- +
- + /*
- + * ------------------------------------------------------------
- + * rs_close()
- + *
- + * This routine is called when the serial port gets closed. First, we
- + * wait for the last remaining data to be sent. Then, we unlink its
- + * async structure from the interrupt chain if necessary, and we free
- + * that IRQ if nothing is left in the chain.
- + * ------------------------------------------------------------
- + */
- +
- + static void rs_close( struct tty_struct *tty, struct file * filp )
- +
- + {
- + struct async_struct * info;
- + int line;
- +
- + if (tty_hung_up_p(filp)) return;
- +
- + line = DEV_TO_SL(tty->line);
- + if ((line < 0) || (line >= NR_PORTS)) return;
- + info = rs_table + line;
- + if (!info->base) return;
- +
- + #ifdef SERIAL_DEBUG_OPEN
- + printk("rs_close ttys%d, count = %d\n", info->line, info->count);
- + #endif
- +
- + if ((tty->count == 1) && (info->count != 1)) {
- + /*
- + * Uh, oh. tty->count is 1, which means that the tty
- + * structure will be freed. Info->count should always
- + * be one in these conditions. If it's greater than
- + * one, we've got real problems, since it means the
- + * serial port won't be shutdown.
- + */
- + printk("rs_close: bad serial port count; tty->count is 1, "
- + "info->count is %d\n", info->count);
- + info->count = 1;
- + }
- + if (--info->count < 0) {
- + printk("rs_close: bad serial port count for ttys%d: %d\n",
- + info->line, info->count);
- + info->count = 0;
- + }
- + if (info->count)
- + return;
- + info->flags |= ASYNC_CLOSING;
- + /*
- + * Save the termios structure, since this port may have
- + * separate termios for callout and dialin.
- + */
- + if (info->flags & ASYNC_NORMAL_ACTIVE)
- + info->normal_termios = *tty->termios;
- + if (info->flags & ASYNC_CALLOUT_ACTIVE)
- + info->callout_termios = *tty->termios;
- + tty->stopped = 0; /* Force flush to succeed */
- + tty->hw_stopped = 0;
- + if (info->flags & ASYNC_INITIALIZED) {
- + rs_start(tty);
- + wait_until_sent(tty, 6000); /* 60 seconds timeout */
- + } else
- + flush_output(tty);
- + flush_input(tty);
- +
- + shutdown(info, 1);
- + clear_bit(line, rs_event);
- + info->event = 0;
- + info->tty = 0;
- + if (info->blocked_open) {
- + if (info->close_delay) {
- + tty->count++; /* avoid race condition */
- + current->state = TASK_INTERRUPTIBLE;
- + current->timeout = jiffies + info->close_delay;
- + schedule();
- + tty->count--;
- + }
- + wake_up_interruptible(&info->open_wait);
- + }
- + info->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CALLOUT_ACTIVE|ASYNC_CLOSING);
- + wake_up_interruptible(&info->close_wait);
- + }
- +
- +
- + /*
- + * rs_hangup() --- called by tty_hangup() when a hangup is signaled.
- + */
- +
- + void rs_hangup( struct tty_struct *tty )
- +
- + {
- + struct async_struct * info;
- + int line;
- +
- + line = DEV_TO_SL(tty->line);
- + if ((line < 0) || (line >= NR_PORTS)) return;
- + info = rs_table + line;
- + if (!info->base) return;
- +
- + shutdown(info, 1);
- + clear_bit(line, rs_event);
- + info->event = 0;
- + info->count = 0;
- + info->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CALLOUT_ACTIVE);
- + info->tty = 0;
- + wake_up_interruptible(&info->open_wait);
- + }
- +
- +
- + /*
- + * ------------------------------------------------------------
- + * rs_open() and friends
- + * ------------------------------------------------------------
- + */
- +
- + static int block_til_ready( struct tty_struct *tty, struct file * filp,
- + struct async_struct *info )
- +
- + {
- + struct wait_queue wait = { current, NULL };
- + int retval;
- + int do_clocal = C_CLOCAL(tty);
- +
- + /*
- + * If the device is in the middle of being closed, then block
- + * until it's done, and then try again.
- + */
- + if (info->flags & ASYNC_CLOSING) {
- + interruptible_sleep_on(&info->close_wait);
- + #ifdef SERIAL_DO_RESTART
- + if (info->flags & ASYNC_HUP_NOTIFY)
- + return -EAGAIN;
- + else
- + return -ERESTARTSYS;
- + #else
- + return -EAGAIN;
- + #endif
- + }
- +
- + /*
- + * If this is a callout device, then just make sure the normal
- + * device isn't being used.
- + */
- + if (MAJOR(filp->f_rdev) == TTYAUX_MAJOR) {
- + if (info->flags & ASYNC_NORMAL_ACTIVE)
- + return -EBUSY;
- + if ((info->flags & ASYNC_CALLOUT_ACTIVE) &&
- + (info->flags & ASYNC_SESSION_LOCKOUT) &&
- + (info->session != current->session))
- + return -EBUSY;
- + if ((info->flags & ASYNC_CALLOUT_ACTIVE) &&
- + (info->flags & ASYNC_PGRP_LOCKOUT) &&
- + (info->pgrp != current->pgrp))
- + return -EBUSY;
- + info->flags |= ASYNC_CALLOUT_ACTIVE;
- + return 0;
- + }
- +
- + /*
- + * If non-blocking mode is set, then make the check up front
- + * and then exit.
- + */
- + if (filp->f_flags & O_NONBLOCK) {
- + if (info->flags & ASYNC_CALLOUT_ACTIVE)
- + return -EBUSY;
- + info->flags |= ASYNC_NORMAL_ACTIVE;
- + return 0;
- + }
- +
- + /*
- + * Block waiting for the carrier detect and the line to become
- + * free (i.e., not in use by the callout). While we are in
- + * this loop, info->count is dropped by one, so that
- + * rs_close() knows when to free things. We restore it upon
- + * exit, either normal or abnormal.
- + */
- + retval = 0;
- + add_wait_queue(&info->open_wait, &wait);
- + #ifdef SERIAL_DEBUG_OPEN
- + printk("block_til_ready before block: ttys%d, count = %d\n",
- + info->line, info->count);
- + #endif
- + info->count--;
- + info->blocked_open++;
- + while (1) {
- + cli();
- + if (!(info->flags & ASYNC_CALLOUT_ACTIVE))
- + info->sw->set_modem_info( info, 1, 1 );
- + sti();
- + current->state = TASK_INTERRUPTIBLE;
- + if (tty_hung_up_p(filp) ||
- + !(info->flags & ASYNC_INITIALIZED)) {
- + #ifdef SERIAL_DO_RESTART
- + if (info->flags & ASYNC_HUP_NOTIFY)
- + retval = -EAGAIN;
- + else
- + retval = -ERESTARTSYS;
- + #else
- + retval = -EAGAIN;
- + #endif
- + break;
- + }
- + if (!(info->flags & ASYNC_CALLOUT_ACTIVE) &&
- + !(info->flags & ASYNC_CLOSING) &&
- + (do_clocal || (info->sw->get_modem_info( info ) & TIOCM_CAR)))
- + break;
- + if (current->signal & ~current->blocked) {
- + retval = -ERESTARTSYS;
- + break;
- + }
- + #ifdef SERIAL_DEBUG_OPEN
- + printk("block_til_ready blocking: ttys%d, count = %d\n",
- + info->line, info->count);
- + #endif
- + schedule();
- + }
- + current->state = TASK_RUNNING;
- + remove_wait_queue(&info->open_wait, &wait);
- + if (!tty_hung_up_p(filp))
- + info->count++;
- + info->blocked_open--;
- + #ifdef SERIAL_DEBUG_OPEN
- + printk("block_til_ready after blocking: ttys%d, count = %d\n",
- + info->line, info->count);
- + #endif
- + if (retval)
- + return retval;
- + info->flags |= ASYNC_NORMAL_ACTIVE;
- + return 0;
- + }
- +
- +
- + /*
- + * This routine is called whenever a serial port is opened.
- + */
- +
- + int rs_open( struct tty_struct *tty, struct file * filp )
- +
- + {
- + struct async_struct *info;
- + int retval, line;
- +
- + line = DEV_TO_SL(tty->line);
- + if ((line < 0) || (line >= NR_PORTS))
- + return( -ENODEV );
- + info = rs_table + line;
- + if (!info->base)
- + return( -ENODEV );
- +
- + #ifdef SERIAL_DEBUG_OPEN
- + printk("rs_open ttyS%d, count = %d\n", info->line, info->count);
- + #endif
- + info->count++;
- + info->tty = tty;
- +
- + tty->write = rs_write;
- + tty->close = rs_close;
- + tty->ioctl = rs_ioctl;
- + tty->throttle = rs_throttle;
- + tty->set_termios = rs_set_termios;
- + tty->stop = rs_stop;
- + tty->start = rs_start;
- + tty->hangup = rs_hangup;
- +
- + if ((info->count == 1) && (info->flags & ASYNC_SPLIT_TERMIOS)) {
- + if (MAJOR(filp->f_rdev) == TTY_MAJOR)
- + *tty->termios = info->normal_termios;
- + else
- + *tty->termios = info->callout_termios;
- + }
- +
- + /*
- + * Start up serial port
- + */
- + if ((retval = startup(info, 1))) return retval;
- +
- + retval = block_til_ready(tty, filp, info);
- + if (retval) {
- + #ifdef SERIAL_DEBUG_OPEN
- + printk( "rs_open returning after block_til_ready with %d\n", retval );
- + #endif
- + return retval;
- + }
- +
- + info->session = current->session;
- + info->pgrp = current->pgrp;
- +
- + #ifdef SERIAL_DEBUG_OPEN
- + printk("rs_open ttyS%d successfull...", info->line);
- + #endif
- + return 0;
- + }
- +
- +
- +
- + /*
- + * Boot-time initialization code: Init the serial ports present on
- + * this machine type.
- + *
- + * Current HW Port to minor/device name mapping:
- + *
- + * Atari
- + * TT | Falcon || minor | name
- + * -----------------------+---------------------------++-------+-------
- + * SCC B (Modem2) | SCC B (Modem) || 64 | ttyS0
- + * SCC A (Serial2/LAN) | SCC A (LAN) || 65 | ttyS1
- + * ST-MFP port (Modem1) | -- || 66 | ttyS2
- + * TT-MFP port (Serial1) | ST-MFP port (no TOS name) || 67 | ttyS3
- + *
- + * The background of this mapping is that I wanted to assign the same
- + * minors to ports with the same capabilities. Staring with the MFPs
- + * would leave a hole in the first position on the Falcon!
- + *
- + * Should Serial2/LAN on the TT be split into two devices, selecting thus
- + * the connector used? Serial2 would be unassigned on the Falcon, and
- + * if one is open, opening the other would block.
- + *
- + * Amiga
- + * Amiga built-in serial port || 64 | ttyS0
- + *
- + */
- +
- + long rs_init( long kmem_start )
- + {
- + int i;
- + struct async_struct *info;
- +
- + memset( &rs_event, 0, sizeof(rs_event) );
- + bh_base[SERIAL_BH].routine = do_softint;
- +
- + /* Initialize the async_struct's */
- + for( i = 0, info = rs_table; i < NR_PORTS; i++, info++ ) {
- + info->line = i;
- + info->base = NULL;
- + info->tty = 0;
- + info->type = PORT_UNKNOWN;
- + info->custom_divisor = 0;
- + info->close_delay = 50;
- + info->x_char = 0;
- + info->event = 0;
- + info->count = 0;
- + info->blocked_open = 0;
- + memset(&info->callout_termios, 0, sizeof(struct termios));
- + memset(&info->normal_termios, 0, sizeof(struct termios));
- + info->open_wait = 0;
- + info->xmit_wait = 0;
- + info->close_wait = 0;
- + }
- +
- + switch (boot_info.machtype) {
- + case MACH_ATARI:
- + #ifdef CONFIG_ATARI
- + /* Now initialize the ports themselves */
- + switch( boot_info.bi_atari.model ) {
- + case ATARI_TT:
- + atari_init_SCC(
- + &rs_table[0],
- + SCC_NORM, /* type */
- + 1, /* Channel B */
- + (void *)&tt_mfp.par_dt_reg, 3, 0 /* RI */
- + );
- + atari_init_SCC(
- + &rs_table[1],
- + SCC_DMA, /* type */
- + 0, /* Channel A */
- + 0, 0, 0 /* no RI */
- + );
- + atari_init_MFPser(
- + &rs_table[2],
- + MFP_CTRL, /* type */
- + 0, /* ST-MFP */
- + (void *)&mfp.par_dt_reg, 6, 0 /* RI */
- + );
- + atari_init_MFPser(
- + &rs_table[3],
- + MFP_BARE, /* type */
- + 1, /* TT_MFP */
- + 0, 0, 0 /* no RI */
- + );
- + break;
- +
- + case ATARI_FALCON:
- + atari_init_SCC(
- + &rs_table[0],
- + SCC_NORM, /* type */
- + 1, /* Channel B */
- + (void *)&mfp.par_dt_reg, 6, 0 /* RI */
- + );
- + atari_init_SCC(
- + &rs_table[1],
- + SCC_NORM, /* type */
- + 0, /* Channel A */
- + 0, 0, 0 /* no RI */
- + );
- + atari_init_MFPser(
- + &rs_table[3],
- + MFP_BARE, /* type */
- + 0, /* ST-MFP */
- + 0, 0, 0 /* no RI */
- + );
- + break;
- + } /* end switch on atari model */
- + #endif /* CONFIG_ATARI */
- + break;
- +
- + case MACH_AMIGA:
- + #ifdef CONFIG_AMIGA
- + printk("ttyS0: Amiga built-in serial port\n");
- + amiga_serinit ( &rs_table[0] );
- + #endif
- + break;
- + } /* end switch on machine type */
- +
- + return( kmem_start );
- + }
- diff -cr --new-file linux-0.9pl1/drivers/char/serial.h linux-0.9pl2/drivers/char/serial.h
- *** linux-0.9pl1/drivers/char/serial.h Wed Dec 31 19:00:00 1969
- --- linux-0.9pl2/drivers/char/serial.h Sun Aug 7 11:51:15 1994
- ***************
- *** 0 ****
- --- 1,322 ----
- +
- + /*
- + * serial.h: Common definitions for the Linux/68k serial driver
- + *
- + * Copyright 1994 Roman Hodek
- + * EMail: rnhodek@cip.informatik.uni-erlangen.de (Internet)
- + * or: Roman_Hodek@n.maus.de (MausNet, NO mail > 16 KB!)
- + *
- + * This file is subject to the terms and conditions of the GNU General Public
- + * License. See the file README.legal in the main directory of this archive
- + * for more details.
- + *
- + */
- +
- +
- + #ifndef _SERIAL_H
- + #define _SERIAL_H
- +
- + #include <linux/tty.h>
- +
- + /* 4 is sufficient for now... */
- + #define NR_PORTS 4
- +
- +
- + /* Structure describing one bit in a register that may be high- or
- + * low-active. This is used for RI detection, because the location of
- + * this signal varies widely. The function TEST_BITPOS() is provided
- + * to return the status of such a bit.
- + */
- +
- + typedef struct {
- + volatile unsigned char *addr; /* address of register */
- + unsigned char bitno; /* bit#, 0..7 */
- + unsigned char active_state; /* 1 for high-active,
- + * 0 for * low-active */
- + } BITPOS;
- +
- + static __inline__ int TEST_BITPOS( BITPOS bp )
- +
- + {
- + return( !bp.addr ? 0 :
- + !!(*(bp.addr) & (1 << bp.bitno)) == bp.active_state );
- + }
- +
- +
- + /* Atari serial port types are numbered from 100 to avoid interference
- + * with the PC types (1..4)
- + */
- + typedef enum {
- + SCC_NORM = 100, /* standard SCC channel */
- + SCC_DMA, /* SCC channel with DMA support */
- + MFP_CTRL, /* standard MFP port with modem control signals */
- + MFP_BARE, /* MFP port without modem controls */
- + SER_AMIGA, /* Amiga built-in serial port */
- + } SERTYPE;
- +
- + /* This function tables does the abstraction from the underlying
- + * hardware:
- + *
- + * init(): Initialize the port as necessary, set RTS and DTR and
- + * enable interrupts. It does not need to set the speed and other
- + * parameters, because change_speed() is called, too.
- + * deinit(): Stop the port (wait for all characters to be sent,
- + * disable interrupts)
- + * enab_tx_int(): Enable or disable the Tx Buffer Empty interrupt
- + * independantly from other interrupt sources. The pointer to
- + * this function may be NULL, if there is no way to do this or it
- + * is too complex. This Tx ints are just disabled to save some
- + * interrupts if the transmitter is stopped anyway.
- + * check_custom_divisor(): Check the given custom divisor for legality
- + * and return 0 if OK, non-zero otherwise.
- + * change_speed(): Set port speed, character size, number of stop
- + * bits and parity from the termios structure. If the user wants
- + * to set the speed with a custom divisor, he is required to
- + * check the baud_base first!
- + * restart(): Is called every time new data arrived in the Tx queue
- + * and may be used to restart the transmitter if it ran empty.
- + * This function is called with interrupts off.
- + * throttle(): Set or clear the RTS line according to 'status'.
- + * set_break(): Set or clear the 'Send a Break' flag.
- + * get_serial_info(): Fill in the baud_base and custom_divisor
- + * fields of a serial_struct. It may also modify other fields, if
- + * needed.
- + * get_modem_info(): Return the status of RTS, DTR, DCD, RI, DSR and CTS.
- + * set_modem_info(): Set the status of RTS and DTR according to
- + * 'new_dtr' and 'new_rts', resp. 0 = clear, 1 = set, -1 = don't change
- + * ioctl(): Process any port-specific ioctl's. This pointer may be
- + * NULL, if the port has no own ioctl's.
- + *
- + */
- +
- + struct async_struct;
- +
- + typedef struct {
- + void (*init)( struct async_struct *info );
- + void (*deinit)( struct async_struct *info, int leave_dtr );
- + void (*enab_tx_int)( struct async_struct *info, int enab_flag );
- + int (*check_custom_divisor)( struct async_struct *info, int divisor );
- + void (*change_speed)( struct async_struct *info );
- + void (*restart)( struct async_struct *info );
- + void (*throttle)( struct async_struct *info, int status );
- + void (*set_break)( struct async_struct *info, int break_flag );
- + void (*get_serial_info)( struct async_struct *info,
- + struct serial_struct *retinfo );
- + unsigned int (*get_modem_info)( struct async_struct *info );
- + int (*set_modem_info)( struct async_struct *info, int new_dtr,
- + int new_rts );
- + int (*ioctl)( struct tty_struct *tty, struct file *file,
- + struct async_struct *info, unsigned int cmd,
- + unsigned long arg );
- + } SERIALSWITCH;
- +
- +
- + /* This is a modified version of the PC-Linux async_struct. Mainly,
- + * stuff like port address, xmit_fifo_size and the like are left out
- + * and other information fields were added.
- + */
- +
- + struct async_struct {
- + /* Atari specific fields */
- + SERTYPE type; /* UART type */
- + volatile void *base; /* base address */
- + BITPOS RI; /* Where the Ring Indicator is signalled */
- + SERIALSWITCH *sw; /* functions to manage this port */
- + /* common fields */
- + int flags;
- + struct tty_struct *tty;
- + int timeout;
- + int custom_divisor;
- + int x_char; /* xon/xoff characater */
- + int close_delay;
- + int event;
- + int line;
- + int count; /* # of fd on device */
- + int blocked_open; /* # of blocked opens */
- + long session; /* Session of opening process */
- + long pgrp; /* pgrp of opening process */
- + struct termios normal_termios;
- + struct termios callout_termios;
- + struct wait_queue *open_wait;
- + struct wait_queue *close_wait;
- + struct wait_queue *xmit_wait;
- + };
- +
- + /*
- + * Events are used to schedule things to happen at timer-interrupt
- + * time, instead of at rs interrupt time.
- + */
- + #define RS_EVENT_READ_PROCESS 0
- + #define RS_EVENT_WRITE_WAKEUP 1
- + #define RS_EVENT_HANGUP 2
- + #define RS_EVENT_BREAK 3
- + #define RS_EVENT_OPEN_WAKEUP 4
- +
- +
- +
- + /***************************** Prototypes *****************************/
- +
- + void rs_stop( struct tty_struct *tty );
- + void rs_start( struct tty_struct *tty );
- + void rs_write( struct tty_struct * tty );
- + void rs_throttle( struct tty_struct * tty, int status );
- + void rs_hangup( struct tty_struct *tty );
- + int rs_open( struct tty_struct *tty, struct file * filp );
- + long rs_init( long kmem_start );
- +
- + /************************* End of Prototypes **************************/
- +
- +
- +
- + /*************************** Inline Functions *************************/
- +
- +
- + #include <linux/interrupt.h>
- + #include <asm/bitops.h>
- +
- + /*
- + * This routine is used by the interrupt handler to schedule
- + * processing in the software interrupt portion of the driver.
- + * It is needed in the port-specific interrupt handlers, so it is
- + * declared here in the common header.
- + */
- +
- + extern char rs_event[];
- +
- + static inline void rs_sched_event( struct async_struct *info, int event )
- +
- + {
- + set_bit(event, &info->event);
- + set_bit(info->line, rs_event);
- + mark_bh(SERIAL_BH);
- + }
- +
- +
- + /* The following functions do common tasks needed in the interrupt
- + * service routine(s):
- + *
- + * - Putting a character into the read_queue, either with or without
- + * an error condition, and waking up processes waiting for
- + * something to arrive
- + * - Check if a throttle is needed due to the read queue getting full
- + * - Removing a character from the write queue, obeying pending flow
- + * control characters
- + * - Checking for enough characters in the write queue to wake up
- + * sleeping processes
- + * - Doing required actions on wait queues if DCD has changed
- + * - Doing required actions on wait queues if CTS has changed;
- + * returns non-zero, if the transmitter should be restarted
- + */
- +
- + static __inline__ void rs_put_char_to_queue( struct async_struct *info,
- + int c, int err )
- +
- + { struct tty_queue *q = &info->tty->read_q;
- +
- + if (!FULL(q)) {
- +
- + if (err) {
- + if (err == TTY_BREAK)
- + rs_sched_event( info, RS_EVENT_BREAK );
- +
- + /* ignore parity errors if parity checking isn't enabled. */
- + if (!(err == TTY_PARITY && !I_INPCK(info->tty))) {
- + set_bit( q->head, &info->tty->readq_flags );
- + c = err;
- + }
- + }
- +
- + q->buf[q->head] = c;
- + INC(q->head);
- +
- + rs_sched_event( info, RS_EVENT_READ_PROCESS );
- + }
- + }
- +
- +
- + static __inline__ void rs_rx_throttle_if_needed( struct async_struct *info )
- +
- + { struct tty_queue *q = &info->tty->read_q;
- +
- + if (LEFT(q) < RQ_THRESHOLD_LW &&
- + !set_bit( TTY_RQ_THROTTLED, &info->tty->flags))
- +
- + rs_throttle( info->tty, TTY_THROTTLE_RQ_FULL );
- + }
- +
- +
- + static __inline__ int rs_get_char_from_queue( struct async_struct *info )
- +
- + { int ch;
- + struct tty_queue *q = &info->tty->write_q;
- +
- + if (info->x_char) {
- + ch = info->x_char;
- + info->x_char = 0;
- + }
- + else if (!EMPTY(q)) {
- + ch = q->buf[q->tail];
- + INC(q->tail);
- + }
- + else {
- + rs_stop( info->tty );
- + ch = -1;
- + }
- +
- + return( ch );
- + }
- +
- +
- + static __inline__ void rs_tx_wakeup_if_needed( struct async_struct *info )
- +
- + { struct tty_queue *q = &info->tty->write_q;
- +
- + if (LEFT(q) > WAKEUP_CHARS) {
- + rs_sched_event( info, RS_EVENT_WRITE_WAKEUP );
- + if (info->tty->write_data_cnt) {
- + set_bit( info->tty->line, &tty_check_write );
- + mark_bh( TTY_BH );
- + }
- + }
- + }
- +
- +
- + static __inline__ void rs_dcd_changed( struct async_struct *info, int dcd )
- +
- + {
- + if (!C_CLOCAL(info->tty)) {
- +
- + if (dcd)
- + rs_sched_event( info, RS_EVENT_OPEN_WAKEUP );
- + else if (!((info->flags & ASYNC_CALLOUT_ACTIVE) &&
- + (info->flags & ASYNC_CALLOUT_NOHUP)))
- + rs_sched_event( info, RS_EVENT_HANGUP );
- + }
- + }
- +
- +
- + static __inline__ int rs_cts_changed( struct async_struct *info, int cts )
- +
- + {
- + if (!C_CRTSCTS(info->tty) || (info->flags & ASYNC_CLOSING))
- + return( 0 );
- +
- + if (info->tty->hw_stopped) {
- + if (cts) {
- + info->tty->hw_stopped = 0;
- + rs_start( info->tty );
- + return( 1 );
- + }
- + }
- + else {
- + if (!cts) {
- + info->tty->hw_stopped = 1;
- + rs_stop( info->tty );
- + }
- + }
- +
- + return( 0 );
- + }
- +
- +
- + #endif /* _SERIAL_H */
- diff -cr --new-file linux-0.9pl1/drivers/scsi/atari_NCR5380.c linux-0.9pl2/drivers/scsi/atari_NCR5380.c
- *** linux-0.9pl1/drivers/scsi/atari_NCR5380.c Sun Jun 26 19:24:04 1994
- --- linux-0.9pl2/drivers/scsi/atari_NCR5380.c Fri Aug 5 12:47:09 1994
- ***************
- *** 459,464 ****
- --- 459,465 ----
- printk("\n");
- }
-
- + #if NDEBUG & (NDEBUG_PIO | NDEBUG_INFORMATION)
- static struct {
- unsigned char value;
- char *name;
- ***************
- *** 494,499 ****
- --- 495,501 ----
- }
- }
- #endif
- + #endif
-
- /*
- * We need to have our corroutine active given these constraints :
- ***************
- *** 642,648 ****
- *prev = instance;
- timer_table[NCR5380_TIMER].expires = expires_first->time_expires;
- timer_active |= 1 << NCR5380_TIMER;
- ! sti;
- return 0;
- }
-
- --- 644,650 ----
- *prev = instance;
- timer_table[NCR5380_TIMER].expires = expires_first->time_expires;
- timer_active |= 1 << NCR5380_TIMER;
- ! sti ();
- return 0;
- }
-
- ***************
- *** 840,846 ****
- hostdata->id_higher_mask |= i;
- for (i = 0; i < 8; ++i)
- hostdata->busy[i] = 0;
- ! #ifdef REAL_DMA
- hostdata->dma_len = 0;
- #endif
- hostdata->connected = NULL;
- --- 842,848 ----
- hostdata->id_higher_mask |= i;
- for (i = 0; i < 8; ++i)
- hostdata->busy[i] = 0;
- ! #if defined (REAL_DMA) || defined (REAL_DMA_POLL)
- hostdata->dma_len = 0;
- #endif
- hostdata->connected = NULL;
- ***************
- *** 1166,1174 ****
- * set in the BASR.
- */
- if (IS_A_TT())
- ! tt_mfp.int_pn_a &= ~0x80;
- else
- ! mfp.int_pn_b &= ~0x80;
- }
- #endif /* !READ_OVERRUNS */
-
- --- 1168,1176 ----
- * set in the BASR.
- */
- if (IS_A_TT())
- ! tt_mfp.int_pn_a = (unsigned char) ~0x80;
- else
- ! mfp.int_pn_b = (unsigned char) ~0x80;
- }
- #endif /* !READ_OVERRUNS */
-
- ***************
- *** 2262,2268 ****
- sti();
- #if (NDEBUG & NDEBUG_QUEUES)
- printk("scsi%d : REQUEST SENSE added to head of issue queue\n",
- ! instance->host_no);
- #endif
- } else
- #endif /* def AUTOSENSE */
- --- 2264,2270 ----
- sti();
- #if (NDEBUG & NDEBUG_QUEUES)
- printk("scsi%d : REQUEST SENSE added to head of issue queue\n",
- ! cmd->host->host_no);
- #endif
- } else
- #endif /* def AUTOSENSE */
- diff -cr --new-file linux-0.9pl1/drivers/scsi/atari_sc.c linux-0.9pl2/drivers/scsi/atari_sc.c
- *** linux-0.9pl1/drivers/scsi/atari_sc.c Sun Jun 26 19:24:06 1994
- --- linux-0.9pl2/drivers/scsi/atari_sc.c Fri Aug 5 13:48:19 1994
- ***************
- *** 81,86 ****
- --- 81,87 ----
- #define READ_OVERRUNS
- #endif
-
- + #include <linux/types.h>
- #include <linux/stddef.h>
- #include <linux/interrupt.h>
- #include <linux/bootinfo.h>
- ***************
- *** 760,771 ****
- #include "atari_NCR5380.c"
-
- #endif /* CONFIG_ATARI_*_SCSI */
- -
- -
- -
- -
- -
- -
- -
- -
- -
- --- 761,763 ----
- diff -cr --new-file linux-0.9pl1/drivers/scsi/gvp11.c linux-0.9pl2/drivers/scsi/gvp11.c
- *** linux-0.9pl1/drivers/scsi/gvp11.c Tue Jun 7 19:39:26 1994
- --- linux-0.9pl2/drivers/scsi/gvp11.c Sun Aug 14 10:09:57 1994
- ***************
- *** 37,50 ****
- }
- }
-
- static int dma_setup (Scsi_Cmnd *cmd, int dir_in)
- {
- unsigned short cntr = GVP11_DMAC_INT_ENABLE;
- unsigned long addr = VTOP(cmd->SCp.ptr);
-
- /* don't allow DMA if the physical address is bad */
- ! if (addr & GVP11_XFER_MASK)
- ! return 1;
-
- /* setup dma direction */
- if (!dir_in)
- --- 37,98 ----
- }
- }
-
- + /*
- + * DMA transfer mask for GVP Series II SCSI controller.
- + * Some versions can only DMA into the 24 bit address space
- + * (0->16M). Others can DMA into the full 32 bit address
- + * space. The default is to only allow DMA into the 24 bit
- + * address space. The "gvp11=0xFFFFFFFE" setup parameter can
- + * be supplied to force an alternate (32 bit) mask.
- + */
- + static int gvp11_xfer_mask = GVP11_XFER_MASK;
- +
- + void gvp11_setup (char *str, int *ints)
- + {
- + gvp11_xfer_mask = ints[1];
- + }
- +
- static int dma_setup (Scsi_Cmnd *cmd, int dir_in)
- {
- unsigned short cntr = GVP11_DMAC_INT_ENABLE;
- unsigned long addr = VTOP(cmd->SCp.ptr);
-
- /* don't allow DMA if the physical address is bad */
- ! if (addr & gvp11_xfer_mask ||
- ! (!dir_in && mm_end_of_chunk (addr, cmd->SCp.this_residual)))
- ! {
- ! HDATA(cmd->host)->dma_bounce_len = (cmd->SCp.this_residual + 511)
- ! & ~0x1ff;
- ! HDATA(cmd->host)->dma_bounce_buffer =
- ! scsi_malloc (HDATA(cmd->host)->dma_bounce_len);
- !
- ! /* can't allocate memory; use PIO */
- ! if (!HDATA(cmd->host)->dma_bounce_buffer) {
- ! HDATA(cmd->host)->dma_bounce_len = 0;
- ! return 1;
- ! }
- !
- ! /* check if the address of the bounce buffer is OK */
- ! addr = VTOP(HDATA(cmd->host)->dma_bounce_buffer);
- !
- ! if (addr & gvp11_xfer_mask) {
- ! scsi_free (HDATA(cmd->host)->dma_bounce_buffer,
- ! HDATA(cmd->host)->dma_bounce_len);
- ! HDATA(cmd->host)->dma_bounce_buffer = NULL;
- ! HDATA(cmd->host)->dma_bounce_len = 0;
- ! return 1;
- ! }
- !
- ! if (!dir_in) {
- ! /* copy to bounce buffer for a write */
- ! if (cmd->use_sg)
- ! panic ("scsi%ddma: incomplete s/g support",
- ! cmd->host->host_no);
- ! else
- ! memcpy (HDATA(cmd->host)->dma_bounce_buffer,
- ! cmd->request_buffer, cmd->request_bufflen);
- ! }
- ! }
-
- /* setup dma direction */
- if (!dir_in)
- ***************
- *** 74,82 ****
- int status)
- {
- /* stop DMA */
- ! DMA(SCpnt->host)->SP_DMA = 1;
- /* remove write bit from CONTROL bits */
- ! DMA(SCpnt->host)->CNTR = GVP11_DMAC_INT_ENABLE;
- }
-
- int gvp11_detect(int host_nr)
- --- 122,148 ----
- int status)
- {
- /* stop DMA */
- ! DMA(instance)->SP_DMA = 1;
- /* remove write bit from CONTROL bits */
- ! DMA(instance)->CNTR = GVP11_DMAC_INT_ENABLE;
- !
- ! /* copy from a bounce buffer, if necessary */
- ! if (status && HDATA(instance)->dma_bounce_buffer) {
- ! if (SCpnt && SCpnt->use_sg) {
- ! panic ("scsi%d: incomplete s/g support",
- ! instance->host_no);
- ! } else {
- ! if (HDATA(instance)->dma_dir && SCpnt)
- ! memcpy (SCpnt->request_buffer,
- ! HDATA(instance)->dma_bounce_buffer,
- ! SCpnt->request_bufflen);
- !
- ! scsi_free (HDATA(instance)->dma_bounce_buffer,
- ! HDATA(instance)->dma_bounce_len);
- ! HDATA(instance)->dma_bounce_buffer = NULL;
- ! HDATA(instance)->dma_bounce_len = 0;
- ! }
- ! }
- }
-
- int gvp11_detect(int host_nr)
- diff -cr --new-file linux-0.9pl1/drivers/scsi/scsi.c linux-0.9pl2/drivers/scsi/scsi.c
- *** linux-0.9pl1/drivers/scsi/scsi.c Thu Jul 7 07:21:59 1994
- --- linux-0.9pl2/drivers/scsi/scsi.c Sun Aug 14 09:51:44 1994
- ***************
- *** 142,147 ****
- --- 142,149 ----
- {"RODIME","RO3000S","2.33"}, /* Locks up if polled for lun != 0 */
- {"SEAGATE", "ST157N", "\004|j"}, /* causes failed REQUEST SENSE on lun 1 for aha152x
- * controller, which causes SCSI code to reset bus.*/
- + {"SEAGATE", "ST138N", "\004|j"}, /* causes failed REQUEST SENSE on lun 1 for aha152x
- + * controller, which causes SCSI code to reset bus.*/
- {"SEAGATE", "ST296","921"}, /* Responds to all lun */
- {"SONY","CD-ROM CDU-541","4.3d"},
- {"TANDBERG","TDC 3600","U07"}, /* Locks up if polled for lun != 0 */
- diff -cr --new-file linux-0.9pl1/fs/minix/bitmap.c linux-0.9pl2/fs/minix/bitmap.c
- *** linux-0.9pl1/fs/minix/bitmap.c Tue Jun 7 19:39:00 1994
- --- linux-0.9pl2/fs/minix/bitmap.c Fri Aug 5 12:46:38 1994
- ***************
- *** 117,127 ****
- }
- repeat:
- j = 8192;
- ! for (i=0 ; i<8 ; i++)
- if ((bh=sb->u.minix_sb.s_zmap[i]) != NULL)
- if ((j=find_first_zero(bh->b_data))<8192)
- break;
- ! if (i>=8 || !bh || j>=8192)
- return 0;
- if (set_bit(BIT(j),bh->b_data)) {
- printk("new_block: bit already set (%d)\n", j);
- --- 117,127 ----
- }
- repeat:
- j = 8192;
- ! for (i=0 ; i<64 ; i++)
- if ((bh=sb->u.minix_sb.s_zmap[i]) != NULL)
- if ((j=find_first_zero(bh->b_data))<8192)
- break;
- ! if (i>=64 || !bh || j>=8192)
- return 0;
- if (set_bit(BIT(j),bh->b_data)) {
- printk("new_block: bit already set (%d)\n", j);
- diff -cr --new-file linux-0.9pl1/fs/minix/fsync.c linux-0.9pl2/fs/minix/fsync.c
- *** linux-0.9pl1/fs/minix/fsync.c Tue Jun 7 19:38:59 1994
- --- linux-0.9pl2/fs/minix/fsync.c Fri Aug 5 12:46:39 1994
- ***************
- *** 5,10 ****
- --- 5,12 ----
- * from
- * Copyright (C) 1991, 1992 Linus Torvalds
- *
- + * Extended for v2 filesystem by Andreas Schwab 1994
- + *
- * minix fsync primitive
- */
-
- ***************
- *** 23,28 ****
- --- 25,31 ----
-
- #define blocksize BLOCK_SIZE
- #define addr_per_block 512
- + #define addr_per_block2 256
-
- static int sync_block (struct inode * inode, unsigned short * block, int wait)
- {
- ***************
- *** 53,58 ****
- --- 56,93 ----
- return 0;
- }
-
- + static int
- + sync_block2 (struct inode *inode, unsigned long *block, int wait)
- + {
- + struct buffer_head *bh;
- + unsigned short tmp;
- +
- + if (!*block)
- + return 0;
- + tmp = *block;
- + bh = get_hash_table (inode->i_dev, *block, blocksize);
- + if (!bh)
- + return 0;
- + if (*block != tmp)
- + {
- + brelse (bh);
- + return 1;
- + }
- + if (wait &&bh->b_req && !bh->b_uptodate)
- + {
- + brelse (bh);
- + return -1;
- + }
- + if (wait || !bh->b_uptodate || !bh->b_dirt)
- + {
- + brelse (bh);
- + return 0;
- + }
- + ll_rw_block (WRITE, 1, &bh);
- + bh->b_count--;
- + return 0;
- + }
- +
- static int sync_iblock (struct inode * inode, unsigned short * iblock,
- struct buffer_head **bh, int wait)
- {
- ***************
- *** 77,82 ****
- --- 112,143 ----
- return 0;
- }
-
- + static int
- + sync_iblock2 (struct inode *inode, unsigned long *iblock,
- + struct buffer_head **bh, int wait)
- + {
- + int rc;
- + unsigned short tmp;
- +
- + *bh = NULL;
- + tmp = *iblock;
- + if (!tmp)
- + return 0;
- + rc = sync_block2 (inode, iblock, wait);
- + if (rc)
- + return rc;
- + *bh = bread (inode->i_dev, tmp, blocksize);
- + if (tmp != *iblock)
- + {
- + brelse (*bh);
- + *bh = NULL;
- + return 1;
- + }
- + if (!*bh)
- + return -1;
- + return 0;
- + }
- +
-
- static int sync_direct(struct inode *inode, int wait)
- {
- ***************
- *** 93,98 ****
- --- 154,176 ----
- return err;
- }
-
- + static int
- + sync_direct2 (struct inode *inode, int wait)
- + {
- + int i;
- + int rc, err = 0;
- +
- + for (i = 0; i < 7; i++)
- + {
- + rc = sync_block2 (inode, inode->u.minix_i.i_data2 + i, wait);
- + if (rc > 0)
- + break;
- + if (rc)
- + err = rc;
- + }
- + return err;
- + }
- +
- static int sync_indirect(struct inode *inode, unsigned short *iblock, int wait)
- {
- int i;
- ***************
- *** 116,121 ****
- --- 194,222 ----
- return err;
- }
-
- + static int
- + sync_indirect2 (struct inode *inode, unsigned long *iblock, int wait)
- + {
- + int i;
- + struct buffer_head *ind_bh;
- + int rc, err = 0;
- +
- + rc = sync_iblock2 (inode, iblock, &ind_bh, wait);
- + if (rc || !ind_bh)
- + return rc;
- +
- + for (i = 0; i < addr_per_block2; i++)
- + {
- + rc = sync_block2 (inode, ((unsigned long *) ind_bh->b_data) + i, wait);
- + if (rc > 0)
- + break;
- + if (rc)
- + err = rc;
- + }
- + brelse (ind_bh);
- + return err;
- + }
- +
- static int sync_dindirect(struct inode *inode, unsigned short *diblock,
- int wait)
- {
- ***************
- *** 140,145 ****
- --- 241,270 ----
- return err;
- }
-
- + static int
- + sync_dindirect2 (struct inode *inode, unsigned long *diblock, int wait)
- + {
- + int i;
- + struct buffer_head *dind_bh;
- + int rc, err = 0;
- +
- + rc = sync_iblock2 (inode, diblock, &dind_bh, wait);
- + if (rc || !dind_bh)
- + return rc;
- +
- + for (i = 0; i < addr_per_block2; i++)
- + {
- + rc = sync_indirect2 (inode, ((unsigned long *) dind_bh->b_data) + i,
- + wait);
- + if (rc > 0)
- + break;
- + if (rc)
- + err = rc;
- + }
- + brelse (dind_bh);
- + return err;
- + }
- +
- int minix_sync_file(struct inode * inode, struct file * file)
- {
- int wait, err = 0;
- ***************
- *** 150,158 ****
- --- 275,293 ----
-
- for (wait=0; wait<=1; wait++)
- {
- + if (inode->i_sb->u.minix_sb.s_version)
- + {
- + err |= sync_direct2 (inode, wait);
- + err |= sync_indirect2 (inode, inode->u.minix_i.i_data2+7, wait);
- + err |= sync_dindirect2 (inode, inode->u.minix_i.i_data2+8, wait);
- + err |= sync_dindirect2 (inode, inode->u.minix_i.i_data2+9, wait);
- + }
- + else
- + {
- err |= sync_direct(inode, wait);
- err |= sync_indirect(inode, inode->u.minix_i.i_data+7, wait);
- err |= sync_dindirect(inode, inode->u.minix_i.i_data+8, wait);
- + }
- }
- err |= minix_sync_inode (inode);
- return (err < 0) ? -EIO : 0;
- diff -cr --new-file linux-0.9pl1/fs/minix/inode.c linux-0.9pl2/fs/minix/inode.c
- *** linux-0.9pl1/fs/minix/inode.c Tue Jun 7 19:39:00 1994
- --- linux-0.9pl2/fs/minix/inode.c Fri Aug 5 12:46:42 1994
- ***************
- *** 3,8 ****
- --- 3,10 ----
- *
- * Copyright (C) 1991, 1992 Linus Torvalds
- *
- + * Extended for v2 filesystem by Andreas Schwab 1994
- + *
- * This file is subject to the terms and conditions of the GNU General Public
- * License. See the file README.legal in the main directory of this archive
- * for more details.
- ***************
- *** 81,86 ****
- --- 83,100 ----
- minix_remount
- };
-
- + static struct super_operations minix_sops_v2 =
- + {
- + minix_read_inode2,
- + NULL,
- + minix_write_inode,
- + minix_put_inode,
- + minix_put_super,
- + minix_write_super,
- + minix_statfs,
- + minix_remount
- + };
- +
- int minix_remount (struct super_block * sb, int * flags, char * data)
- {
- struct minix_super_block * ms;
- ***************
- *** 122,127 ****
- --- 136,171 ----
- #define BIT(bit) (bit)
- #endif
-
- + static int
- + get_dirsize (struct super_block *s)
- + {
- + struct buffer_head *bh;
- + struct inode *dir;
- + struct minix_dir_entry *entry;
- + int dirsize;
- +
- + dir = s->s_mounted;
- + bh = minix_bread (dir, 0, 0);
- + if (!bh)
- + {
- + printk ("MINIX-fs: unable to read root directory\n");
- + return 0;
- + }
- + for (dirsize = 16; dirsize < BLOCK_SIZE; dirsize <<= 1)
- + {
- + entry = (struct minix_dir_entry *) (bh->b_data + dirsize);
- + if (strcmp (entry->name, "..") == 0)
- + {
- + s->u.minix_sb.s_dirsize = dirsize;
- + s->u.minix_sb.s_namelen = dirsize - 2;
- + brelse (bh);
- + return 1;
- + }
- + }
- + printk ("MINIX-fs: unable to get directory size\n");
- + return 0;
- + }
- +
- struct super_block *minix_read_super(struct super_block *s,void *data,
- int silent)
- {
- ***************
- *** 132,137 ****
- --- 176,183 ----
-
- if (32 != sizeof (struct minix_inode))
- panic("bad i-node size");
- + if (64 != sizeof (struct new_minix_inode))
- + panic("bad v2 i-node size");
- lock_super(s);
- if (!(bh = bread(dev,1,BLOCK_SIZE))) {
- s->s_dev=0;
- ***************
- *** 156,165 ****
- if (s->s_magic == MINIX_SUPER_MAGIC) {
- s->u.minix_sb.s_dirsize = 16;
- s->u.minix_sb.s_namelen = 14;
- } else if (s->s_magic == MINIX_SUPER_MAGIC2) {
- s->u.minix_sb.s_dirsize = 32;
- s->u.minix_sb.s_namelen = 30;
- ! } else {
- s->s_dev = 0;
- unlock_super(s);
- brelse(bh);
- --- 202,221 ----
- if (s->s_magic == MINIX_SUPER_MAGIC) {
- s->u.minix_sb.s_dirsize = 16;
- s->u.minix_sb.s_namelen = 14;
- + s->u.minix_sb.s_version = 0;
- } else if (s->s_magic == MINIX_SUPER_MAGIC2) {
- s->u.minix_sb.s_dirsize = 32;
- s->u.minix_sb.s_namelen = 30;
- ! s->u.minix_sb.s_version = 0;
- ! }
- ! else if (s->s_magic == NEW_MINIX_SUPER_MAGIC)
- ! {
- ! s->u.minix_sb.s_dirsize = 16;
- ! s->u.minix_sb.s_namelen = 14;
- ! s->u.minix_sb.s_nzones = ms->s_zones;
- ! s->u.minix_sb.s_version = 1;
- ! }
- ! else {
- s->s_dev = 0;
- unlock_super(s);
- brelse(bh);
- ***************
- *** 171,176 ****
- --- 227,242 ----
- s->u.minix_sb.s_imap[i] = NULL;
- for (i=0;i < MINIX_Z_MAP_SLOTS;i++)
- s->u.minix_sb.s_zmap[i] = NULL;
- + if (s->u.minix_sb.s_imap_blocks > MINIX_I_MAP_SLOTS
- + || s->u.minix_sb.s_zmap_blocks > MINIX_Z_MAP_SLOTS)
- + {
- + s->s_dev = 0;
- + unlock_super (s);
- + brelse (bh);
- + if (!silent)
- + printk ("MINIX-fs: filesystem too big\n");
- + return NULL;
- + }
- block=2;
- for (i=0 ; i < s->u.minix_sb.s_imap_blocks ; i++)
- if ((s->u.minix_sb.s_imap[i]=bread(dev,block,BLOCK_SIZE)) != NULL)
- ***************
- *** 198,204 ****
- unlock_super(s);
- /* set up enough so that it can read an inode */
- s->s_dev = dev;
- ! s->s_op = &minix_sops;
- s->s_mounted = iget(s,MINIX_ROOT_INO);
- if (!s->s_mounted) {
- s->s_dev = 0;
- --- 264,273 ----
- unlock_super(s);
- /* set up enough so that it can read an inode */
- s->s_dev = dev;
- ! if (s->u.minix_sb.s_version)
- ! s->s_op = &minix_sops_v2;
- ! else
- ! s->s_op = &minix_sops;
- s->s_mounted = iget(s,MINIX_ROOT_INO);
- if (!s->s_mounted) {
- s->s_dev = 0;
- ***************
- *** 206,211 ****
- --- 275,287 ----
- printk("MINIX-fs: get root inode failed\n");
- return NULL;
- }
- + if (!get_dirsize (s))
- + {
- + iput (s->s_mounted);
- + s->s_dev = 0;
- + brelse (bh);
- + return NULL;
- + }
- if (!(s->s_flags & MS_RDONLY)) {
- ms->s_state &= ~MINIX_VALID_FS;
- bh->b_dirt = 1;
- ***************
- *** 239,244 ****
- --- 315,321 ----
- }
-
- #define inode_bmap(inode,nr) ((inode)->u.minix_i.i_data[(nr)])
- + #define inode_bmap2(inode,nr) ((inode)->u.minix_i.i_data2[(nr)])
-
- static int block_bmap(struct buffer_head * bh, int nr)
- {
- ***************
- *** 251,256 ****
- --- 328,345 ----
- return tmp;
- }
-
- + static int
- + block_bmap2 (struct buffer_head *bh, int nr)
- + {
- + int tmp;
- +
- + if (!bh)
- + return 0;
- + tmp = ((unsigned long *) bh->b_data)[nr];
- + brelse (bh);
- + return tmp;
- + }
- +
- int minix_bmap(struct inode * inode,int block)
- {
- int i;
- ***************
- *** 259,264 ****
- --- 348,390 ----
- printk("minix_bmap: block<0");
- return 0;
- }
- + if (inode->i_sb->u.minix_sb.s_version)
- + {
- + int ind_nr;
- +
- + if (block >= 7 + 256 + 256 * 256 * 2)
- + {
- + printk ("minix_bmap2: block > big");
- + return 0;
- + }
- + if (block < 7)
- + return inode_bmap2 (inode, block);
- + block -= 7;
- + if (block < 256)
- + {
- + i = inode_bmap2 (inode, 7);
- + if (!i)
- + return 0;
- + return block_bmap2 (bread (inode->i_dev, i, BLOCK_SIZE),
- + block);
- + }
- + block -= 256;
- + if (block >= 256 * 256)
- + {
- + ind_nr = 9;
- + block -= 256 * 256;
- + }
- + else
- + ind_nr = 8;
- + i = inode_bmap2 (inode, ind_nr);
- + if (!i)
- + return 0;
- + i = block_bmap2 (bread (inode->i_dev, i, BLOCK_SIZE), block >> 8);
- + if (!i)
- + return 0;
- + return block_bmap2 (bread (inode->i_dev, i, BLOCK_SIZE),
- + block & 255);
- + }
- if (block >= 7+512+512*512) {
- printk("minix_bmap: block>big");
- return 0;
- ***************
- *** 315,320 ****
- --- 441,482 ----
- return result;
- }
-
- + static struct buffer_head *
- + inode_getblk2 (struct inode *inode, int nr, int create)
- + {
- + int tmp;
- + unsigned long *p;
- + struct buffer_head *result;
- +
- + p = inode->u.minix_i.i_data2 + nr;
- + repeat:
- + tmp = *p;
- + if (tmp)
- + {
- + result = getblk (inode->i_dev, tmp, BLOCK_SIZE);
- + if (tmp == *p)
- + return result;
- + brelse (result);
- + goto repeat;
- + }
- + if (!create)
- + return NULL;
- + tmp = minix_new_block (inode->i_sb);
- + if (!tmp)
- + return NULL;
- + result = getblk (inode->i_dev, tmp, BLOCK_SIZE);
- + if (*p)
- + {
- + minix_free_block (inode->i_sb, tmp);
- + brelse (result);
- + goto repeat;
- + }
- + *p = tmp;
- + inode->i_ctime = CURRENT_TIME;
- + inode->i_dirt = 1;
- + return result;
- + }
- +
- static struct buffer_head * block_getblk(struct inode * inode,
- struct buffer_head * bh, int nr, int create)
- {
- ***************
- *** 365,370 ****
- --- 527,589 ----
- return result;
- }
-
- + static struct buffer_head *
- + block_getblk2 (struct inode *inode, struct buffer_head *bh, int nr, int create)
- + {
- + int tmp;
- + unsigned long *p;
- + struct buffer_head *result;
- +
- + if (!bh)
- + return NULL;
- + if (!bh->b_uptodate)
- + {
- + ll_rw_block (READ, 1, &bh);
- + wait_on_buffer (bh);
- + if (!bh->b_uptodate)
- + {
- + brelse (bh);
- + return NULL;
- + }
- + }
- + p = nr + (unsigned long *) bh->b_data;
- + repeat:
- + tmp = *p;
- + if (tmp)
- + {
- + result = getblk (bh->b_dev, tmp, BLOCK_SIZE);
- + if (tmp == *p)
- + {
- + brelse (bh);
- + return result;
- + }
- + brelse (result);
- + goto repeat;
- + }
- + if (!create)
- + {
- + brelse (bh);
- + return NULL;
- + }
- + tmp = minix_new_block (inode->i_sb);
- + if (!tmp)
- + {
- + brelse (bh);
- + return NULL;
- + }
- + result = getblk (bh->b_dev, tmp, BLOCK_SIZE);
- + if (*p)
- + {
- + minix_free_block (inode->i_sb,tmp);
- + brelse (result);
- + goto repeat;
- + }
- + *p = tmp;
- + bh->b_dirt = 1;
- + brelse (bh);
- + return result;
- + }
- +
- struct buffer_head * minix_getblk(struct inode * inode, int block, int create)
- {
- struct buffer_head * bh;
- ***************
- *** 373,378 ****
- --- 592,626 ----
- printk("minix_getblk: block<0");
- return NULL;
- }
- + if (inode->i_sb->u.minix_sb.s_version)
- + {
- + int ind_nr;
- +
- + if (block >= 7 + 256 + 256 * 256 * 2)
- + {
- + printk ("minix_getblk: block > big");
- + return NULL;
- + }
- + if (block < 7)
- + return inode_getblk2 (inode, block, create);
- + block -= 7;
- + if (block < 256)
- + {
- + bh = inode_getblk2 (inode, 7, create);
- + return block_getblk2 (inode, bh, block, create);
- + }
- + block -= 256;
- + if (block >= 256 * 256)
- + {
- + ind_nr = 9;
- + block -= 256 * 256;
- + }
- + else
- + ind_nr = 8;
- + bh = inode_getblk2 (inode, ind_nr, create);
- + bh = block_getblk2 (inode, bh, block >> 8, create);
- + return block_getblk2 (inode, bh, block & 255, create);
- + }
- if (block >= 7+512+512*512) {
- printk("minix_getblk: block>big");
- return NULL;
- ***************
- *** 455,460 ****
- --- 703,764 ----
- init_fifo(inode);
- }
-
- + void
- + minix_read_inode2 (struct inode *inode)
- + {
- + struct buffer_head *bh;
- + struct new_minix_inode *raw_inode;
- + int block, ino;
- +
- + ino = inode->i_ino;
- + inode->i_op = NULL;
- + inode->i_mode = 0;
- + if (!ino || (ulong) ino >= inode->i_sb->u.minix_sb.s_ninodes)
- + {
- + printk ("Bad inode number on dev 0x%04x: %d is out of range\n",
- + inode->i_dev, ino);
- + return;
- + }
- + block = (2 + inode->i_sb->u.minix_sb.s_imap_blocks
- + + inode->i_sb->u.minix_sb.s_zmap_blocks
- + + (ino - 1) / MINIX_INODES_PER_BLOCK2);
- + bh = bread (inode->i_dev,block, BLOCK_SIZE);
- + if (!bh)
- + {
- + printk ("Major problem: unable to read inode from dev 0x%04x\n",
- + inode->i_dev);
- + return;
- + }
- + raw_inode = ((struct new_minix_inode *) bh->b_data
- + + (ino - 1) % MINIX_INODES_PER_BLOCK2);
- + inode->i_mode = raw_inode->i_mode;
- + inode->i_uid = raw_inode->i_uid;
- + inode->i_gid = raw_inode->i_gid;
- + inode->i_nlink = raw_inode->i_nlinks;
- + inode->i_size = raw_inode->i_size;
- + inode->i_mtime = raw_inode->i_mtime;
- + inode->i_atime = raw_inode->i_atime;
- + inode->i_ctime = raw_inode->i_ctime;
- + inode->i_blocks = inode->i_blksize = 0;
- + if (S_ISCHR (inode->i_mode) || S_ISBLK (inode->i_mode))
- + inode->i_rdev = raw_inode->i_zone[0];
- + else for (block = 0; block < 10; block++)
- + inode->u.minix_i.i_data2[block] = raw_inode->i_zone[block];
- + brelse (bh);
- + if (S_ISREG (inode->i_mode))
- + inode->i_op = &minix_file_inode_operations;
- + else if (S_ISDIR (inode->i_mode))
- + inode->i_op = &minix_dir_inode_operations;
- + else if (S_ISLNK (inode->i_mode))
- + inode->i_op = &minix_symlink_inode_operations;
- + else if (S_ISCHR (inode->i_mode))
- + inode->i_op = &chrdev_inode_operations;
- + else if (S_ISBLK (inode->i_mode))
- + inode->i_op = &blkdev_inode_operations;
- + else if (S_ISFIFO (inode->i_mode))
- + init_fifo (inode);
- + }
- +
- static struct buffer_head * minix_update_inode(struct inode * inode)
- {
- struct buffer_head * bh;
- ***************
- *** 492,501 ****
- return bh;
- }
-
- void minix_write_inode(struct inode * inode)
- {
- struct buffer_head *bh;
- ! bh = minix_update_inode(inode);
- brelse(bh);
- }
-
- --- 796,853 ----
- return bh;
- }
-
- + static struct buffer_head *
- + minix_update_inode2 (struct inode *inode)
- + {
- + struct buffer_head *bh;
- + struct new_minix_inode *raw_inode;
- + int ino, block;
- +
- + ino = inode->i_ino;
- + if (!ino || (ulong) ino >= inode->i_sb->u.minix_sb.s_ninodes)
- + {
- + printk ("Bad inode number on dev 0x%04x: %d is out of range\n",
- + inode->i_dev, ino);
- + inode->i_dirt = 0;
- + return 0;
- + }
- + block = (2 + inode->i_sb->u.minix_sb.s_imap_blocks
- + + inode->i_sb->u.minix_sb.s_zmap_blocks
- + + (ino - 1) / MINIX_INODES_PER_BLOCK2);
- + bh = bread (inode->i_dev, block, BLOCK_SIZE);
- + if (!bh)
- + {
- + printk ("unable to read i-node block\n");
- + inode->i_dirt = 0;
- + return 0;
- + }
- + raw_inode = ((struct new_minix_inode *) bh->b_data
- + + (ino - 1) % MINIX_INODES_PER_BLOCK2);
- + raw_inode->i_mode = inode->i_mode;
- + raw_inode->i_uid = inode->i_uid;
- + raw_inode->i_gid = inode->i_gid;
- + raw_inode->i_nlinks = inode->i_nlink;
- + raw_inode->i_size = inode->i_size;
- + raw_inode->i_atime = inode->i_atime;
- + raw_inode->i_mtime = inode->i_mtime;
- + raw_inode->i_ctime = inode->i_ctime;
- + if (S_ISCHR (inode->i_mode) || S_ISBLK (inode->i_mode))
- + raw_inode->i_zone[0] = inode->i_rdev;
- + else
- + for (block = 0; block < 10; block++)
- + raw_inode->i_zone[block] = inode->u.minix_i.i_data2[block];
- + inode->i_dirt = 0;
- + bh->b_dirt = 1;
- + return bh;
- + }
- +
- void minix_write_inode(struct inode * inode)
- {
- struct buffer_head *bh;
- ! if (inode->i_sb->u.minix_sb.s_version)
- ! bh = minix_update_inode2 (inode);
- ! else
- ! bh = minix_update_inode(inode);
- brelse(bh);
- }
-
- ***************
- *** 525,530 ****
- --- 877,914 ----
- raw_inode = ((struct minix_inode *) bh->b_data
- + (ino - 1) % MINIX_INODES_PER_BLOCK);
- raw_inode->i_nlinks = 0;
- + raw_inode->i_mode = 0;
- + bh->b_dirt = 1;
- + return bh;
- + }
- +
- + static struct buffer_head *
- + minix_clear_link2 (struct inode *inode)
- + {
- + struct buffer_head *bh;
- + struct new_minix_inode *raw_inode;
- + int ino, block;
- +
- + ino = inode->i_ino;
- + if (!ino || (ulong) ino >= inode->i_sb->u.minix_sb.s_ninodes)
- + {
- + printk ("Bad inode number on dev 0x%04x: %d is out of range\n",
- + inode->i_dev, ino);
- + return 0;
- + }
- + block = (2 + inode->i_sb->u.minix_sb.s_imap_blocks
- + + inode->i_sb->u.minix_sb.s_zmap_blocks
- + + (ino - 1) / MINIX_INODES_PER_BLOCK2);
- + bh = bread (inode->i_dev, block, BLOCK_SIZE);
- + if (!bh)
- + {
- + printk ("unable to read i-node block\n");
- + return 0;
- + }
- + raw_inode = ((struct new_minix_inode *) bh->b_data
- + + (ino - 1) % MINIX_INODES_PER_BLOCK2);
- + raw_inode->i_nlinks = 0;
- + raw_inode->i_mode = 0;
- bh->b_dirt = 1;
- return bh;
- }
- ***************
- *** 533,539 ****
- minix_clear_inode (struct inode *inode)
- {
- struct buffer_head *bh;
- ! bh = minix_clear_link (inode);
- brelse (bh);
- }
-
- --- 917,926 ----
- minix_clear_inode (struct inode *inode)
- {
- struct buffer_head *bh;
- ! if (inode->i_sb->u.minix_sb.s_version)
- ! bh = minix_clear_link2 (inode);
- ! else
- ! bh = minix_clear_link (inode);
- brelse (bh);
- }
-
- ***************
- *** 542,548 ****
- int err = 0;
- struct buffer_head *bh;
-
- ! bh = minix_update_inode(inode);
- if (bh && bh->b_dirt)
- {
- ll_rw_block(WRITE, 1, &bh);
- --- 929,938 ----
- int err = 0;
- struct buffer_head *bh;
-
- ! if (inode->i_sb->u.minix_sb.s_version)
- ! bh = minix_update_inode2 (inode);
- ! else
- ! bh = minix_update_inode(inode);
- if (bh && bh->b_dirt)
- {
- ll_rw_block(WRITE, 1, &bh);
- diff -cr --new-file linux-0.9pl1/fs/minix/truncate.c linux-0.9pl2/fs/minix/truncate.c
- *** linux-0.9pl1/fs/minix/truncate.c Tue Jun 7 19:38:59 1994
- --- linux-0.9pl2/fs/minix/truncate.c Fri Aug 5 12:46:43 1994
- ***************
- *** 3,8 ****
- --- 3,10 ----
- *
- * Copyright (C) 1991, 1992 Linus Torvalds
- *
- + * Extended for v2 filesystem by Andreas Schwab 1994
- + *
- * This file is subject to the terms and conditions of the GNU General Public
- * License. See the file README.legal in the main directory of this archive
- * for more details.
- ***************
- *** 58,63 ****
- --- 60,101 ----
- return retry;
- }
-
- + static int
- + trunc_direct2 (struct inode *inode)
- + {
- + unsigned long *p;
- + struct buffer_head *bh;
- + int i, tmp;
- + int retry = 0;
- + #define DIRECT_BLOCK2 ((inode->i_size + 1023) >> 10)
- +
- + repeat:
- + for (i = DIRECT_BLOCK2; i < 7; i++)
- + {
- + p = i + inode->u.minix_i.i_data2;
- + tmp = *p;
- + if (!tmp)
- + continue;
- + bh = get_hash_table (inode->i_dev, tmp, BLOCK_SIZE);
- + if (i < DIRECT_BLOCK2)
- + {
- + brelse (bh);
- + goto repeat;
- + }
- + if ((bh && bh->b_count != 1) || tmp != *p)
- + {
- + retry = 1;
- + brelse (bh);
- + continue;
- + }
- + *p = 0;
- + inode->i_dirt = 1;
- + brelse (bh);
- + minix_free_block (inode->i_sb, tmp);
- + }
- + return retry;
- + }
- +
- static int trunc_indirect(struct inode * inode, int offset, unsigned short * p)
- {
- struct buffer_head * bh;
- ***************
- *** 119,124 ****
- --- 157,233 ----
- brelse(ind_bh);
- return retry;
- }
- +
- + static int
- + trunc_indirect2 (struct inode *inode, int offset, unsigned long *p)
- + {
- + struct buffer_head *bh;
- + int i, tmp;
- + struct buffer_head *ind_bh;
- + unsigned long *ind;
- + int retry = 0;
- + #define INDIRECT_BLOCK2 (DIRECT_BLOCK2 - offset)
- +
- + tmp = *p;
- + if (!tmp)
- + return 0;
- + ind_bh = bread (inode->i_dev, tmp, BLOCK_SIZE);
- + if (tmp != *p)
- + {
- + brelse (ind_bh);
- + return 1;
- + }
- + if (!ind_bh)
- + {
- + *p = 0;
- + return 0;
- + }
- + repeat:
- + for (i = INDIRECT_BLOCK2; i < 256; i++)
- + {
- + if (i < 0)
- + i = 0;
- + if (i < INDIRECT_BLOCK2)
- + goto repeat;
- + ind = i + (unsigned long *) ind_bh->b_data;
- + tmp = *ind;
- + if (!tmp)
- + continue;
- + bh = get_hash_table (inode->i_dev, tmp, BLOCK_SIZE);
- + if (i < INDIRECT_BLOCK2)
- + {
- + brelse (bh);
- + goto repeat;
- + }
- + if ((bh && bh->b_count != 1) || tmp != *ind)
- + {
- + retry = 1;
- + brelse (bh);
- + continue;
- + }
- + *ind = 0;
- + ind_bh->b_dirt = 1;
- + brelse (bh);
- + minix_free_block (inode->i_sb, tmp);
- + }
- + ind = (unsigned long *) ind_bh->b_data;
- + for (i = 0; i < 256; i++)
- + if (*ind++)
- + break;
- + if (i >= 256)
- + {
- + if (ind_bh->b_count != 1)
- + retry = 1;
- + else
- + {
- + tmp = *p;
- + *p = 0;
- + minix_free_block (inode->i_sb, tmp);
- + }
- + }
- + brelse (ind_bh);
- + return retry;
- + }
-
- static int trunc_dindirect(struct inode * inode)
- {
- ***************
- *** 166,171 ****
- --- 275,334 ----
- brelse(dind_bh);
- return retry;
- }
- +
- + static int
- + trunc_dindirect2 (struct inode *inode, int nr)
- + {
- + int i, tmp;
- + struct buffer_head *dind_bh;
- + unsigned long *dind, *p;
- + int retry = 0;
- + int offset = nr ? 256 * 256 : 0;
- + #define DINDIRECT_BLOCK2 ((DIRECT_BLOCK2 - (256 + 7) - offset) >> 8)
- +
- + p = 8 + nr + inode->u.minix_i.i_data2;
- + tmp = *p;
- + if (!tmp)
- + return 0;
- + dind_bh = bread (inode->i_dev, tmp, BLOCK_SIZE);
- + if (tmp != *p)
- + {
- + brelse (dind_bh);
- + return 1;
- + }
- + if (!dind_bh)
- + {
- + *p = 0;
- + return 0;
- + }
- + repeat:
- + for (i = DINDIRECT_BLOCK2; i < 256; i++)
- + {
- + if (i < 0)
- + i = 0;
- + if (i < DINDIRECT_BLOCK2)
- + goto repeat;
- + dind = i + (unsigned long *) dind_bh->b_data;
- + retry |= trunc_indirect2 (inode, 7 + 256 + offset + (i << 8), dind);
- + dind_bh->b_dirt = 1;
- + }
- + dind = (unsigned long *) dind_bh->b_data;
- + for (i = 0; i < 256; i++)
- + if (*dind++)
- + break;
- + if (i >= 256)
- + if (dind_bh->b_count != 1)
- + retry = 1;
- + else
- + {
- + tmp = *p;
- + *p = 0;
- + inode->i_dirt = 1;
- + minix_free_block (inode->i_sb, tmp);
- + }
- + brelse (dind_bh);
- + return retry;
- + }
-
- void minix_truncate(struct inode * inode)
- {
- ***************
- *** 175,183 ****
- S_ISLNK(inode->i_mode)))
- return;
- while (1) {
- ! retry = trunc_direct(inode);
- ! retry |= trunc_indirect(inode,7,inode->u.minix_i.i_data+7);
- ! retry |= trunc_dindirect(inode);
- if (!retry)
- break;
- current->counter = 0;
- --- 338,357 ----
- S_ISLNK(inode->i_mode)))
- return;
- while (1) {
- ! if (inode->i_sb->u.minix_sb.s_version)
- ! {
- ! retry = trunc_direct2 (inode);
- ! retry |= trunc_indirect2 (inode, 7,
- ! inode->u.minix_i.i_data2 + 7);
- ! retry |= trunc_dindirect2 (inode, 0);
- ! retry |= trunc_dindirect2 (inode, 1);
- ! }
- ! else
- ! {
- ! retry = trunc_direct(inode);
- ! retry |= trunc_indirect(inode,7,inode->u.minix_i.i_data+7);
- ! retry |= trunc_dindirect(inode);
- ! }
- if (!retry)
- break;
- current->counter = 0;
- diff -cr --new-file linux-0.9pl1/fs/msdos/namei.c linux-0.9pl2/fs/msdos/namei.c
- *** linux-0.9pl1/fs/msdos/namei.c Sun Jun 26 20:11:31 1994
- --- linux-0.9pl2/fs/msdos/namei.c Fri Aug 5 12:47:11 1994
- ***************
- *** 4,9 ****
- --- 4,11 ----
- * Written 1992,1993 by Werner Almesberger
- */
-
- + #include <linux/autoconf.h>
- +
- #include <asm/segment.h>
-
- #include <linux/sched.h>
- ***************
- *** 16,31 ****
- --- 18,40 ----
- /* MS-DOS "device special files" */
-
- static char *reserved_names[] = {
- + #ifndef CONFIG_ATARI /* GEMDOS is less stupid */
- "CON ","PRN ","NUL ","AUX ",
- "LPT1 ","LPT2 ","LPT3 ","LPT4 ",
- "COM1 ","COM2 ","COM3 ","COM4 ",
- + #endif
- NULL };
-
-
- /* Characters that are undesirable in an MS-DOS file name */
-
- static char bad_chars[] = "*?<>|\"";
- + #ifdef CONFIG_ATARI
- + /* GEMDOS is less restrictive */
- + static char bad_if_strict[] = " ";
- + #else
- static char bad_if_strict[] = "+=,; ";
- + #endif
-
-
- /* Formats an MS-DOS file name. Rejects invalid names. */
- ***************
- *** 44,50 ****
- --- 53,63 ----
- while (len--) *res++ = '.';
- return 0;
- }
- + #ifndef CONFIG_ATARI
- space = 1; /* disallow names starting with a dot */
- + #else
- + space = 0; /* GEMDOS does not care */
- + #endif
- c = 0;
- for (walk = res; len && walk-res < 8; walk++) {
- c = *name++;
- diff -cr --new-file linux-0.9pl1/fs/proc/array.c linux-0.9pl2/fs/proc/array.c
- *** linux-0.9pl1/fs/proc/array.c Tue Jun 14 17:20:40 1994
- --- linux-0.9pl2/fs/proc/array.c Fri Aug 5 12:46:29 1994
- ***************
- *** 455,460 ****
- --- 455,462 ----
- }
- #elif defined(__mc68000__)
- pagedir = (*p)->tss.pagedir_v;
- + if (pagedir)
- + {
- for (i = 0; i < NUM_L1_ENTRIES-1; ++i) {
- unsigned long *ptrp, *ptrpe;
- if ((ptbl = pagedir[i]) == 0) {
- ***************
- *** 493,498 ****
- --- 495,501 ----
- }
- }
- }
- + }
- #endif /* arch */
- }
- return sprintf(buffer,"%d %d %d %d %d %d %d\n",
- diff -cr --new-file linux-0.9pl1/include/asm/segment.h linux-0.9pl2/include/asm/segment.h
- *** linux-0.9pl1/include/asm/segment.h Tue Jun 7 19:38:20 1994
- --- linux-0.9pl2/include/asm/segment.h Sun Aug 7 15:26:59 1994
- ***************
- *** 68,73 ****
- --- 68,74 ----
-
- static inline void __generic_memcpy_tofs(void * to, const void * from, unsigned long n)
- {
- + if (n == 0) return;
- __asm__ __volatile__ ("1:\n\t"
- "moveb %1@+,d0\n\t"
- "movesb d0,%2@+\n\t"
- ***************
- *** 160,166 ****
- return;
- case 3:
- *(short *) to = get_user_word((const short *) from);
- ! *(char *) to = get_user_byte(2+(const char *) from);
- return;
- case 4:
- *(int *) to = get_user_long((const int *) from);
- --- 161,167 ----
- return;
- case 3:
- *(short *) to = get_user_word((const short *) from);
- ! *(2+(char *) to) = get_user_byte(2+(const char *) from);
- return;
- case 4:
- *(int *) to = get_user_long((const int *) from);
- diff -cr --new-file linux-0.9pl1/include/linux/atariconf.h linux-0.9pl2/include/linux/atariconf.h
- *** linux-0.9pl1/include/linux/atariconf.h Wed Jun 29 16:13:33 1994
- --- linux-0.9pl2/include/linux/atariconf.h Fri Aug 5 12:47:12 1994
- ***************
- *** 22,27 ****
- --- 22,28 ----
- extern unsigned long atari_keyb_init(unsigned long);
- extern void atari_init_INTS (void);
- extern int atari_add_isr (unsigned long, isrfunc, int, void *);
- + extern void atari_process_int (int level, struct intframe *fp);
- extern unsigned long atari_gettimeoffset (void);
- extern void atari_gettod (struct mktime *);
- extern void atari_check_partition (struct gendisk *hd, unsigned int dev);
- ***************
- *** 34,39 ****
- --- 35,41 ----
- extern struct consw ata_con;
-
-
- + #if 0
- /* This function tests for the presence of an address, specially a
- * hardware register address. It is called very early in the kernel
- * initialization process, when the VBR register isn't set up yet. On
- ***************
- *** 69,74 ****
- --- 71,77 ----
-
- return( ret );
- }
- + #endif
-
- static __inline__ void config_atari(void)
- {
- ***************
- *** 76,81 ****
- --- 79,85 ----
- mach_keyb_init = atari_keyb_init;
- mach_init_INTS = atari_init_INTS;
- mach_add_isr = atari_add_isr;
- + mach_process_int = atari_process_int;
- mach_gettimeoffset = atari_gettimeoffset;
- mach_gettod = atari_gettod;
- mach_check_partition = atari_check_partition;
- ***************
- *** 83,92 ****
- --- 87,99 ----
- mach_reset = atari_reset;
- mach_floppy_init = atari_floppy_init;
- mach_floppy_change = atari_floppy_change;
- + #ifdef CONFIG_ATARI_FALCON_IDE
- mach_hd_init = atari_hd_init;
- mach_hd_setup = atari_hd_setup;
- + #endif
- conswitchp = &ata_con;
-
- + #if 0 /* ++andreas: this is now done in the bootstrapper */
- /* ++roman:
- * Determine hardware model: TT or Falcon (for now, others may be added)
- * This is done by probing access to certain hardware registers unique to
- ***************
- *** 106,111 ****
- --- 113,122 ----
- printk( "unknown!\n" );
- panic( "Cannot determine Atari model.\n" );
- }
- + #endif
- +
- + /* allocator for memory that must reside in st-ram */
- + atari_stram_init ();
- }
-
- #endif /* linux/atariconf.h */
- diff -cr --new-file linux-0.9pl1/include/linux/atarihw.h linux-0.9pl2/include/linux/atarihw.h
- *** linux-0.9pl1/include/linux/atarihw.h Sun Jun 26 20:09:18 1994
- --- linux-0.9pl2/include/linux/atarihw.h Fri Aug 5 12:47:12 1994
- ***************
- *** 18,23 ****
- --- 18,27 ----
-
- #include <linux/types.h>
-
- + /* Memory used for screen ram and stdma buffers */
- + void atari_stram_init (void);
- + void *atari_stram_alloc (long size);
- + void atari_stram_free (void *);
-
- /*
- ** Shifter
- ***************
- *** 132,137 ****
- --- 136,142 ----
- u_char dma_md;
- u_char char_dummy3;
- u_char dma_lo;
- + u_short fdc_speed;
- };
- # define dma_wd ((*(volatile struct DMA_WD *)FWD_BAS))
- /* alias */
- diff -cr --new-file linux-0.9pl1/include/linux/atariints.h linux-0.9pl2/include/linux/atariints.h
- *** linux-0.9pl1/include/linux/atariints.h Sun Jun 26 20:09:19 1994
- --- linux-0.9pl2/include/linux/atariints.h Fri Aug 5 12:47:13 1994
- ***************
- *** 20,69 ****
- **
- */
-
- ! #define IRQ_MFP_BUSY (8)
- ! #define IRQ_MFP_DCD (9)
- ! #define IRQ_MFP_CTS (10)
- ! #define IRQ_MFP_GPU (11)
- ! #define IRQ_MFP_TIMD (12)
- ! #define IRQ_MFP_TIMC (13)
- ! #define IRQ_MFP_ACIA (14)
- ! #define IRQ_MFP_FDC (15)
- ! #define IRQ_MFP_TIMB (16)
- ! #define IRQ_MFP_SERERR (17)
- ! #define IRQ_MFP_SEREMPT (18)
- ! #define IRQ_MFP_RECERR (19)
- ! #define IRQ_MFP_RECFULL (20)
- ! #define IRQ_MFP_TIMA (21)
- ! #define IRQ_MFP_RI (22)
- ! #define IRQ_MFP_MMD (23)
-
- #define IRQ_FLOPPY IRQ_MFP_FDC
-
- ! #define IRQ_TT_MFP_IO0 (24)
- ! #define IRQ_TT_MFP_IO1 (25)
- ! #define IRQ_TT_MFP_SCC (26)
- ! #define IRQ_TT_MFP_RI (27)
- ! #define IRQ_TT_MFP_TIMD (28)
- ! #define IRQ_TT_MFP_TIMC (29)
- ! #define IRQ_TT_MFP_DRVRDY (30)
- ! #define IRQ_TT_MFP_SCSIDMA (31)
- ! #define IRQ_TT_MFP_TIMB (32)
- ! #define IRQ_TT_MFP_SERERR (33)
- ! #define IRQ_TT_MFP_SEREMPT (34)
- ! #define IRQ_TT_MFP_RECERR (35)
- ! #define IRQ_TT_MFP_RECFULL (36)
- ! #define IRQ_TT_MFP_TIMA (37)
- ! #define IRQ_TT_MFP_RTC (38)
- ! #define IRQ_TT_MFP_SCSI (39)
- !
- ! #define IRQ_SCCB_TX (40)
- ! #define IRQ_SCCB_STAT (42)
- ! #define IRQ_SCCB_RX (44)
- ! #define IRQ_SCCB_SPCOND (46)
- ! #define IRQ_SCCA_TX (48)
- ! #define IRQ_SCCA_STAT (50)
- ! #define IRQ_SCCA_RX (52)
- ! #define IRQ_SCCA_SPCOND (54)
-
- /* INTREQR masks */
- #define IRQ1_MASK 0x0007 /* INTREQR mask for IRQ 1 */
- --- 20,74 ----
- **
- */
-
- ! #define NUM_ATARI_SOURCES (48)
- ! #define STMFP_SOURCE_BASE 0
- ! #define TTMFP_SOURCE_BASE 16
- ! #define SCC_SOURCE_BASE 32
- !
- ! #define IRQ_MFP_BUSY (IRQ_MACHSPEC | 0)
- ! #define IRQ_MFP_DCD (IRQ_MACHSPEC | 1)
- ! #define IRQ_MFP_CTS (IRQ_MACHSPEC | 2)
- ! #define IRQ_MFP_GPU (IRQ_MACHSPEC | 3)
- ! #define IRQ_MFP_TIMD (IRQ_MACHSPEC | 4)
- ! #define IRQ_MFP_TIMC (IRQ_MACHSPEC | 5)
- ! #define IRQ_MFP_ACIA (IRQ_MACHSPEC | 6)
- ! #define IRQ_MFP_FDC (IRQ_MACHSPEC | 7)
- ! #define IRQ_MFP_TIMB (IRQ_MACHSPEC | 8)
- ! #define IRQ_MFP_SERERR (IRQ_MACHSPEC | 9)
- ! #define IRQ_MFP_SEREMPT (IRQ_MACHSPEC | 10)
- ! #define IRQ_MFP_RECERR (IRQ_MACHSPEC | 11)
- ! #define IRQ_MFP_RECFULL (IRQ_MACHSPEC | 12)
- ! #define IRQ_MFP_TIMA (IRQ_MACHSPEC | 13)
- ! #define IRQ_MFP_RI (IRQ_MACHSPEC | 14)
- ! #define IRQ_MFP_MMD (IRQ_MACHSPEC | 15)
-
- #define IRQ_FLOPPY IRQ_MFP_FDC
-
- ! #define IRQ_TT_MFP_IO0 (IRQ_MACHSPEC | 16)
- ! #define IRQ_TT_MFP_IO1 (IRQ_MACHSPEC | 17)
- ! #define IRQ_TT_MFP_SCC (IRQ_MACHSPEC | 18)
- ! #define IRQ_TT_MFP_RI (IRQ_MACHSPEC | 19)
- ! #define IRQ_TT_MFP_TIMD (IRQ_MACHSPEC | 20)
- ! #define IRQ_TT_MFP_TIMC (IRQ_MACHSPEC | 21)
- ! #define IRQ_TT_MFP_DRVRDY (IRQ_MACHSPEC | 22)
- ! #define IRQ_TT_MFP_SCSIDMA (IRQ_MACHSPEC | 23)
- ! #define IRQ_TT_MFP_TIMB (IRQ_MACHSPEC | 24)
- ! #define IRQ_TT_MFP_SERERR (IRQ_MACHSPEC | 25)
- ! #define IRQ_TT_MFP_SEREMPT (IRQ_MACHSPEC | 26)
- ! #define IRQ_TT_MFP_RECERR (IRQ_MACHSPEC | 27)
- ! #define IRQ_TT_MFP_RECFULL (IRQ_MACHSPEC | 28)
- ! #define IRQ_TT_MFP_TIMA (IRQ_MACHSPEC | 29)
- ! #define IRQ_TT_MFP_RTC (IRQ_MACHSPEC | 30)
- ! #define IRQ_TT_MFP_SCSI (IRQ_MACHSPEC | 31)
- !
- ! #define IRQ_SCCB_TX (IRQ_MACHSPEC | 32)
- ! #define IRQ_SCCB_STAT (IRQ_MACHSPEC | 34)
- ! #define IRQ_SCCB_RX (IRQ_MACHSPEC | 36)
- ! #define IRQ_SCCB_SPCOND (IRQ_MACHSPEC | 38)
- ! #define IRQ_SCCA_TX (IRQ_MACHSPEC | 40)
- ! #define IRQ_SCCA_STAT (IRQ_MACHSPEC | 42)
- ! #define IRQ_SCCA_RX (IRQ_MACHSPEC | 44)
- ! #define IRQ_SCCA_SPCOND (IRQ_MACHSPEC | 46)
-
- /* INTREQR masks */
- #define IRQ1_MASK 0x0007 /* INTREQR mask for IRQ 1 */
- ***************
- *** 91,97 ****
- #define IF_I13 0x0002
- #define IF_I14 0x0001
-
- ! #define INT_CLK 24576 /* CLK while int_clk =2.456MHz and divide = 100 */
- ! #define INT_TICKS 246 /* to make sched_time = 99.9024 HZ */
-
- #endif /* linux/atariints.h */
- --- 96,104 ----
- #define IF_I13 0x0002
- #define IF_I14 0x0001
-
- ! /* ++andreas: INT_TICKS changed to make perfect 100 Hz clock */
- !
- ! #define INT_CLK 24576 /* CLK while int_clk =2.456MHz and divide = 64 */
- ! #define INT_TICKS 384 /* to make sched_time = 100 HZ */
-
- #endif /* linux/atariints.h */
- diff -cr --new-file linux-0.9pl1/include/linux/bootinfo.h linux-0.9pl2/include/linux/bootinfo.h
- *** linux-0.9pl1/include/linux/bootinfo.h Sun Jun 26 19:54:24 1994
- --- linux-0.9pl2/include/linux/bootinfo.h Fri Aug 5 12:47:14 1994
- ***************
- *** 62,70 ****
-
- struct bi_Atari {
- AtariModel model;
- ! /* needs not be initialized by bootstrap! ---
- ! model is determined at run time in
- ! config_atari() */
- };
-
- /*
- --- 62,69 ----
-
- struct bi_Atari {
- AtariModel model;
- ! unsigned long stram_start; /* Start of unmapped ST-RAM */
- ! unsigned long stram_size; /* Size of unmapped ST-RAM */
- };
-
- /*
- diff -cr --new-file linux-0.9pl1/include/linux/config.h linux-0.9pl2/include/linux/config.h
- *** linux-0.9pl1/include/linux/config.h Wed Jun 29 16:17:07 1994
- --- linux-0.9pl2/include/linux/config.h Fri Aug 5 12:47:14 1994
- ***************
- *** 48,53 ****
- --- 48,54 ----
- extern void (*mach_init_INTS) (void);
- extern int (*mach_add_isr) (unsigned long source, isrfunc isr,
- int pri, void *data);
- + extern void (*mach_process_int) (int level, struct intframe *fp);
- extern unsigned long (*mach_gettimeoffset)(void);
- struct mktime;
- extern void (*mach_gettod)(struct mktime*);
- diff -cr --new-file linux-0.9pl1/include/linux/console.h linux-0.9pl2/include/linux/console.h
- *** linux-0.9pl1/include/linux/console.h Sun Jun 26 23:40:29 1994
- --- linux-0.9pl2/include/linux/console.h Fri Aug 5 12:46:30 1994
- ***************
- *** 53,59 ****
- unsigned long vc_ques : 1;
- unsigned long vc_need_wrap : 1;
- unsigned long vc_tab_stop[5]; /* Tab stops. 160 columns. */
- - unsigned char vc_kbdmode;
- unsigned char * vc_translate;
- unsigned char * vc_G0_charset;
- unsigned char * vc_G1_charset;
- --- 53,58 ----
- diff -cr --new-file linux-0.9pl1/include/linux/fd.h linux-0.9pl2/include/linux/fd.h
- *** linux-0.9pl1/include/linux/fd.h Tue Jun 7 19:38:27 1994
- --- linux-0.9pl2/include/linux/fd.h Sun Aug 7 11:37:28 1994
- ***************
- *** 15,20 ****
- --- 15,23 ----
- #define FDFMTTRK 7 /* format the specified track */
- #define FDFMTEND 8 /* end formatting a disk */
- #define FDSETEMSGTRESH 10 /* set fdc error reporting treshold */
- + #define FDFLUSH 11 /* flush buffers for media; either for verifying media, or
- + for handling a media change without closing the file
- + descriptor */
-
- /*
- ** Misc definitions
- diff -cr --new-file linux-0.9pl1/include/linux/interrupt.h linux-0.9pl2/include/linux/interrupt.h
- *** linux-0.9pl1/include/linux/interrupt.h Sun Jun 26 20:09:20 1994
- --- linux-0.9pl2/include/linux/interrupt.h Fri Aug 5 12:47:15 1994
- ***************
- *** 30,47 ****
- #define IRQ7 (7) /* level 7 interrupt (non-maskable) */
-
- /*
- - * ++roman: Some machines have more than 7 interrupt sources!
- - */
- -
- - #ifdef CONFIG_ATARI
- - # define NUM_INT_SOURCES 56
- - # define FIRST_NONAUTO_VEC 64
- - #else
- - # define NUM_INT_SOURCES 7
- - #endif
- -
- -
- - /*
- * "Generic" interrupt sources
- */
-
- --- 30,35 ----
- diff -cr --new-file linux-0.9pl1/include/linux/lp.h linux-0.9pl2/include/linux/lp.h
- *** linux-0.9pl1/include/linux/lp.h Tue Jun 7 19:38:29 1994
- --- linux-0.9pl2/include/linux/lp.h Fri Aug 5 13:37:43 1994
- ***************
- *** 3,14 ****
- --- 3,18 ----
-
- /*
- * usr/include/linux/lp.h modified for Amiga by Michael Rausch
- + * modified for Atari by Andreas Schwab
- *
- * linux i386 version c.1991-1992 James Wiegand
- * many modifications copyright (C) 1992 Michael K. Johnson
- * Interrupt support added 1993 Nigel Gamble
- */
-
- + #include <linux/autoconf.h>
- + #include <linux/bootinfo.h>
- +
- /*
- * Per POSIX guidelines, this module reserves the LP and lp prefixes
- * These are the lp_table[minor].flags flags...
- ***************
- *** 80,91 ****
- #define LP_NO 1
-
-
- ! #define LP_OUT(c) ciaa.prb = c
-
- /* busy is low-active, and so are the cia bits */
- ! #define LP_IS_BUSY (ciab.pra & 1)
- ! #define LP_HAS_POUT (ciab.pra & 2)
- ! #define LP_IS_ONLINE (ciab.pra & 4)
-
- /*
- * function prototypes
- --- 84,204 ----
- #define LP_NO 1
-
-
- ! #define AMIGA_LP_OUT(c) ciaa.prb = c
-
- /* busy is low-active, and so are the cia bits */
- ! #define AMIGA_LP_IS_BUSY() (ciab.pra & 1)
- ! #define AMIGA_LP_HAS_POUT() (ciab.pra & 2)
- ! #define AMIGA_LP_IS_ONLINE() (ciab.pra & 4)
- !
- ! /* LP_OUT must be executed with interrupts blocked */
- ! #define ATARI_LP_OUT(c) (sound_ym.rd_data_reg_sel = 15, \
- ! sound_ym.wd_data = c, \
- ! sound_ym.rd_data_reg_sel = 14, \
- ! sound_ym.wd_data = sound_ym.rd_data_reg_sel & ~(1 << 5), \
- ! udelay (1), \
- ! sound_ym.wd_data = sound_ym.rd_data_reg_sel | (1 << 5))
- !
- ! #define ATARI_LP_IS_BUSY() (mfp.par_dt_reg & 1)
- ! #define ATARI_LP_HAS_POUT() 0
- ! #define ATARI_LP_IS_ONLINE() !ATARI_LP_IS_BUSY() /* or 1 XXX */
- !
- ! #if defined (CONFIG_AMIGA) + defined (CONFIG_ATARI) == 1
- !
- ! #ifdef CONFIG_AMIGA
- ! #define LP_OUT(c) AMIGA_LP_OUT(c)
- ! #define LP_IS_BUSY() AMIGA_LP_IS_BUSY
- ! #define LP_HAS_POUT() AMIGA_LP_HAS_POUT
- ! #define LP_IS_ONLINE() AMIGA_LP_IS_ONLINE
- ! #endif
- ! #ifdef CONFIG_ATARI
- ! #define LP_OUT(c) ATARI_LP_OUT(c)
- ! #define LP_IS_BUSY() ATARI_LP_IS_BUSY
- ! #define LP_HAS_POUT() ATARI_LP_HAS_POUT
- ! #define LP_IS_ONLINE() ATARI_LP_IS_ONLINE
- ! #endif
- !
- ! #else /* multi configuration */
- !
- ! static __inline__ void
- ! LP_OUT (int c)
- ! {
- ! switch (boot_info.machtype)
- ! {
- ! #ifdef CONFIG_AMIGA
- ! case MACH_AMIGA:
- ! AMIGA_LP_OUT (c);
- ! break;
- ! #endif
- ! #ifdef CONFIG_ATARI
- ! case MACH_ATARI:
- ! ATARI_LP_OUT (c);
- ! break;
- ! #endif
- ! }
- ! }
- !
- ! static __inline__ int
- ! LP_IS_BUSY (void)
- ! {
- ! switch (boot_info.machtype)
- ! {
- ! #ifdef CONFIG_AMIGA
- ! case MACH_AMIGA:
- ! return AMIGA_LP_IS_BUSY ();
- ! break;
- ! #endif
- ! #ifdef CONFIG_ATARI
- ! case MACH_ATARI:
- ! return ATARI_LP_IS_BUSY ();
- ! break;
- ! #endif
- ! default:
- ! return 0;
- ! }
- ! }
- !
- ! static __inline__ int
- ! LP_HAS_POUT (void)
- ! {
- ! switch (boot_info.machtype)
- ! {
- ! #ifdef CONFIG_AMIGA
- ! case MACH_AMIGA:
- ! return AMIGA_LP_HAS_POUT ();
- ! break;
- ! #endif
- ! #ifdef CONFIG_ATARI
- ! case MACH_ATARI:
- ! return ATARI_LP_HAS_POUT ();
- ! break;
- ! #endif
- ! default:
- ! return 0;
- ! }
- ! }
- !
- ! static __inline__ int
- ! LP_IS_ONLINE (void)
- ! {
- ! switch (boot_info.machtype)
- ! {
- ! #ifdef CONFIG_AMIGA
- ! case MACH_AMIGA:
- ! return AMIGA_LP_IS_ONLINE ();
- ! break;
- ! #endif
- ! #ifdef CONFIG_ATARI
- ! case MACH_ATARI:
- ! return ATARI_LP_IS_ONLINE ();
- ! break;
- ! #endif
- ! default:
- ! return 0;
- ! }
- ! }
- !
- ! #endif
-
- /*
- * function prototypes
- diff -cr --new-file linux-0.9pl1/include/linux/minix_fs.h linux-0.9pl2/include/linux/minix_fs.h
- *** linux-0.9pl1/include/linux/minix_fs.h Tue Jun 7 19:38:24 1994
- --- linux-0.9pl2/include/linux/minix_fs.h Fri Aug 5 12:46:43 1994
- ***************
- *** 22,35 ****
- #define MINIX_LINK_MAX 250
-
- #define MINIX_I_MAP_SLOTS 8
- ! #define MINIX_Z_MAP_SLOTS 8
- #define MINIX_SUPER_MAGIC 0x137F /* original minix fs */
- #define MINIX_SUPER_MAGIC2 0x138F /* minix fs, 30 char names */
- ! #define NEW_MINIX_SUPER_MAGIC 0x2468 /* minix V2 - not implemented */
- #define MINIX_VALID_FS 0x0001 /* Clean fs. */
- #define MINIX_ERROR_FS 0x0002 /* fs has errors. */
-
- #define MINIX_INODES_PER_BLOCK ((BLOCK_SIZE)/(sizeof (struct minix_inode)))
-
- struct minix_inode {
- unsigned short i_mode;
- --- 22,36 ----
- #define MINIX_LINK_MAX 250
-
- #define MINIX_I_MAP_SLOTS 8
- ! #define MINIX_Z_MAP_SLOTS 64
- #define MINIX_SUPER_MAGIC 0x137F /* original minix fs */
- #define MINIX_SUPER_MAGIC2 0x138F /* minix fs, 30 char names */
- ! #define NEW_MINIX_SUPER_MAGIC 0x2468 /* minix V2 */
- #define MINIX_VALID_FS 0x0001 /* Clean fs. */
- #define MINIX_ERROR_FS 0x0002 /* fs has errors. */
-
- #define MINIX_INODES_PER_BLOCK ((BLOCK_SIZE)/(sizeof (struct minix_inode)))
- + #define MINIX_INODES_PER_BLOCK2 ((BLOCK_SIZE)/sizeof (struct new_minix_inode))
-
- struct minix_inode {
- unsigned short i_mode;
- ***************
- *** 72,77 ****
- --- 73,79 ----
- unsigned long s_max_size;
- unsigned short s_magic;
- unsigned short s_state;
- + unsigned long s_zones; /* long version of s_nzones for v2 */
- };
-
- struct minix_dir_entry {
- ***************
- *** 110,115 ****
- --- 112,118 ----
- extern void minix_write_super(struct super_block *);
- extern int minix_remount (struct super_block * sb, int * flags, char * data);
- extern void minix_read_inode(struct inode *);
- + extern void minix_read_inode2 (struct inode *);
- extern void minix_write_inode(struct inode *);
- extern void minix_clear_inode (struct inode *);
- extern void minix_put_inode(struct inode *);
- diff -cr --new-file linux-0.9pl1/include/linux/minix_fs_i.h linux-0.9pl2/include/linux/minix_fs_i.h
- *** linux-0.9pl1/include/linux/minix_fs_i.h Tue Jun 7 19:38:24 1994
- --- linux-0.9pl2/include/linux/minix_fs_i.h Fri Aug 5 12:46:44 1994
- ***************
- *** 10,15 ****
- --- 10,16 ----
- */
- struct minix_inode_info {
- unsigned short i_data[16];
- + unsigned long i_data2[16];
- };
-
- #endif
- diff -cr --new-file linux-0.9pl1/include/linux/minix_fs_sb.h linux-0.9pl2/include/linux/minix_fs_sb.h
- *** linux-0.9pl1/include/linux/minix_fs_sb.h Tue Jun 7 19:38:24 1994
- --- linux-0.9pl2/include/linux/minix_fs_sb.h Fri Aug 5 12:46:44 1994
- ***************
- *** 17,25 ****
- unsigned long s_log_zone_size;
- unsigned long s_max_size;
- struct buffer_head * s_imap[8];
- ! struct buffer_head * s_zmap[8];
- unsigned long s_dirsize;
- unsigned long s_namelen;
- struct buffer_head * s_sbh;
- struct minix_super_block * s_ms;
- unsigned short s_mount_state;
- --- 17,26 ----
- unsigned long s_log_zone_size;
- unsigned long s_max_size;
- struct buffer_head * s_imap[8];
- ! struct buffer_head * s_zmap[64];
- unsigned long s_dirsize;
- unsigned long s_namelen;
- + int s_version;
- struct buffer_head * s_sbh;
- struct minix_super_block * s_ms;
- unsigned short s_mount_state;
- diff -cr --new-file linux-0.9pl1/include/linux/mm.h linux-0.9pl2/include/linux/mm.h
- *** linux-0.9pl1/include/linux/mm.h Tue Jun 7 19:38:28 1994
- --- linux-0.9pl2/include/linux/mm.h Fri Aug 5 12:46:31 1994
- ***************
- *** 32,39 ****
- return -EFAULT;
- if (size > TASK_SIZE - (unsigned long) addr)
- return -EFAULT;
- ! #elif defined(__m368000_)
- ! if (current->pid != 1 && TASK_SIZE <= (unsigned long addr)
- return -EFAULT;
- if (current->pid != 1 && size > TASK_SIZE - (unsigned long) addr)
- return -EFAULT;
- --- 32,39 ----
- return -EFAULT;
- if (size > TASK_SIZE - (unsigned long) addr)
- return -EFAULT;
- ! #elif defined(__m68000__)
- ! if (current->pid != 1 && TASK_SIZE <= (unsigned long) addr)
- return -EFAULT;
- if (current->pid != 1 && size > TASK_SIZE - (unsigned long) addr)
- return -EFAULT;
- diff -cr --new-file linux-0.9pl1/include/linux/ptrace.h linux-0.9pl2/include/linux/ptrace.h
- *** linux-0.9pl1/include/linux/ptrace.h Sun Jun 26 20:09:22 1994
- --- linux-0.9pl2/include/linux/ptrace.h Fri Aug 5 12:46:32 1994
- ***************
- *** 85,90 ****
- --- 85,91 ----
- /* set's the trap flag. */
- #define TRAP_FLAG 0x100
-
- + #ifdef __KERNEL__
- /*
- * this is the number to subtract from the top of the stack. To find
- * the local frame.
- ***************
- *** 101,106 ****
- --- 102,109 ----
- tmp = ptrace_get_stack_long((child), \
- sizeof(long)*EFL-MAGICNUMBER) & ~TRAP_FLAG; \
- ptrace_put_stack_long((child),sizeof(long)*EFL-MAGICNUMBER,tmp); } while(0)
- + #endif /* __KERNEL__ */
- +
- #elif defined(__mc68000__)
-
- #define PT_D1 0
- ***************
- *** 149,154 ****
- --- 152,158 ----
- short sr;
- long pc;
- short fmtvec;
- + short __fill; /* to make it longword aligned */
- };
-
- /* determines which bits in the SR the user has access to. */
- ***************
- *** 158,163 ****
- --- 162,168 ----
- /* sets the trace bits. */
- #define TRACE_BITS 0x8000
-
- + #ifdef __KERNEL__
- #define ptrace_setsingle(child) \
- do { long tmp; \
- tmp = ptrace_get_stack_long((child), \
- ***************
- *** 168,182 ****
- --- 173,191 ----
- tmp = ptrace_get_stack_long((child), \
- sizeof(long)*PT_SR) & ~TRACE_BITS; \
- ptrace_put_stack_long((child),sizeof(long)*PT_SR,tmp); } while(0)
- + #endif /* __KERNEL__ */
- +
- #else
- #error Architecture not supported
- #endif /* architecture */
-
- + #ifdef __KERNEL__
- extern int ptrace_put_stack_long (struct task_struct *, int, unsigned long);
- extern int ptrace_get_stack_long (struct task_struct *, int);
- extern int ptrace_read_long(struct task_struct *, long, unsigned long *);
- extern int ptrace_write_long(struct task_struct *, long, long);
- extern int ptrace_peekusr(struct task_struct *, long, long);
- extern int ptrace_pokeusr(struct task_struct *, long, long);
- + #endif
-
- #endif /* _LINUX_PTRACE_H */
- diff -cr --new-file linux-0.9pl1/include/linux/traps.h linux-0.9pl2/include/linux/traps.h
- *** linux-0.9pl1/include/linux/traps.h Sun Jun 26 20:09:22 1994
- --- linux-0.9pl2/include/linux/traps.h Fri Aug 5 12:47:17 1994
- ***************
- *** 224,230 ****
- * as seen by an interrupt handler routine.
- */
- struct intframe {
- - unsigned long regs[4]; /* d0-d1,a0-a1 */
- unsigned short sr; /* status register */
- unsigned long pc; /* program counter */
- unsigned format : 4; /* frame format specifier */
- --- 224,229 ----
- diff -cr --new-file linux-0.9pl1/include/linux/user.h linux-0.9pl2/include/linux/user.h
- *** linux-0.9pl1/include/linux/user.h Tue Jun 7 19:38:26 1994
- --- linux-0.9pl2/include/linux/user.h Fri Aug 5 12:46:32 1994
- ***************
- *** 47,54 ****
- };
-
- struct user_m68kfp_struct {
- - unsigned long fpcntl[3]; /* fp control regs */
- unsigned long fpregs[24]; /* fp0-fp7 registers */
- };
-
- /* When the kernel dumps core, it starts by dumping the user struct -
- --- 47,54 ----
- };
-
- struct user_m68kfp_struct {
- unsigned long fpregs[24]; /* fp0-fp7 registers */
- + unsigned long fpcntl[3]; /* fp control regs */
- };
-
- /* When the kernel dumps core, it starts by dumping the user struct -
- diff -cr --new-file linux-0.9pl1/init/config.c linux-0.9pl2/init/config.c
- *** linux-0.9pl1/init/config.c Wed Jun 29 16:17:29 1994
- --- linux-0.9pl2/init/config.c Fri Aug 5 12:47:17 1994
- ***************
- *** 48,53 ****
- --- 48,54 ----
- unsigned long (*mach_keyb_init) (unsigned long);
- void (*mach_init_INTS) (void);
- int (*mach_add_isr) (unsigned long, isrfunc, int, void *);
- + void (*mach_process_int) (int, struct intframe *) = NULL;
- unsigned long (*mach_gettimeoffset) (void);
- void (*mach_gettod) (struct mktime*);
- void (*mach_check_partition) (struct gendisk *, unsigned int);
- diff -cr --new-file linux-0.9pl1/init/main.c linux-0.9pl2/init/main.c
- *** linux-0.9pl1/init/main.c Tue Jul 26 22:29:09 1994
- --- linux-0.9pl2/init/main.c Sun Aug 14 09:17:03 1994
- ***************
- *** 102,107 ****
- --- 102,108 ----
- extern void video_setup(char *str, int *ints);
- extern void atari_video_setup (char *str, int *ints);
- extern void wd33c93_setup (char *str, int *ints);
- + extern void gvp11_setup (char *str, int *ints);
-
- #ifdef CONFIG_SYSVIPC
- extern void ipc_init(void);
- ***************
- *** 230,235 ****
- --- 231,239 ----
- || defined(CONFIG_GVP11_SCSI)
- { "wd33c93=", wd33c93_setup },
- #endif
- + #if defined(CONFIG_GVP11_SCSI)
- + { "gvp11=", gvp11_setup },
- + #endif
- { 0, 0 }
- };
-
- ***************
- *** 329,340 ****
- --- 333,354 ----
- break;
- }
- }
- + continue;
- } else if (!strcmp(line,"ro"))
- + {
- root_mountflags |= MS_RDONLY;
- + continue;
- + }
- else if (!strcmp(line,"rw"))
- + {
- root_mountflags &= ~MS_RDONLY;
- + continue;
- + }
- else if (!strcmp(line,"debug"))
- + {
- console_loglevel = 10;
- + continue;
- + }
- else if (!strcmp(line,"no387")) {
- hard_math = 0;
- #ifdef __i386__
- ***************
- *** 342,349 ****
- "orl $0xE,%%eax\n\t"
- "movl %%eax,%%cr0\n\t" : : : "ax");
- #endif
- } else
- ! checksetup(line);
- /*
- * Then check if it's an environment variable or
- * an option.
- --- 356,365 ----
- "orl $0xE,%%eax\n\t"
- "movl %%eax,%%cr0\n\t" : : : "ax");
- #endif
- + continue;
- } else
- ! if (!checksetup(line))
- ! continue;
- /*
- * Then check if it's an environment variable or
- * an option.
- diff -cr --new-file linux-0.9pl1/kernel/sched.c linux-0.9pl2/kernel/sched.c
- *** linux-0.9pl1/kernel/sched.c Sun Jun 26 21:51:32 1994
- --- linux-0.9pl2/kernel/sched.c Fri Aug 5 12:46:34 1994
- ***************
- *** 108,114 ****
- } stack_start = { & user_stack [PAGE_SIZE>>2] , KERNEL_DS };
-
- struct kernel_stat kstat =
- ! { 0, 0, 0, { 0, 0, 0, 0 }, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
-
- /*
- * int 0x80 entry points.. Moved away from the header file, as
- --- 108,114 ----
- } stack_start = { & user_stack [PAGE_SIZE>>2] , KERNEL_DS };
-
- struct kernel_stat kstat =
- ! { 0, 0, 0, { 0, 0, 0, 0 }, 0, 0, 0, 0, { 0 }, 0, 0, 0, 0, 0, 0 };
-
- /*
- * int 0x80 entry points.. Moved away from the header file, as
- diff -cr --new-file linux-0.9pl1/m68k/head.S linux-0.9pl2/m68k/head.S
- *** linux-0.9pl1/m68k/head.S Sun Jun 26 15:22:47 1994
- --- linux-0.9pl2/m68k/head.S Fri Aug 5 12:47:19 1994
- ***************
- *** 6,11 ****
- --- 6,14 ----
- **
- ** 68040 fixes by Michael Rausch
- **
- + ** Atari support by Andreas Schwab, using ideas of Robert de Vries
- + ** and Bjoern Brauel
- + **
- ** This file is subject to the terms and conditions of the GNU General Public
- ** License. See the file README.legal in the main directory of this archive
- ** for more details.
- ***************
- *** 29,36 ****
- * Enable cache memories
- * Jump to kernel startup
- *
- ! * Register d6 contains the CPU flags from the boot_info information
- ! * for most of this file.
- */
-
- .text
- --- 32,39 ----
- * Enable cache memories
- * Jump to kernel startup
- *
- ! * Register d6 contains the CPU flags and d4 the machine type
- ! * from the boot_info information for most of this file.
- */
-
- .text
- ***************
- *** 42,47 ****
- --- 45,51 ----
- BI_MACH = 0
- BI_AMIGA_ECLK = 1234
- MACH_AMIGA = 1
- + MACH_ATARI = 2
- LF = 10
- CR = 13
- BIT040 = 2
- ***************
- *** 111,120 ****
- bsr Lserial_putc
-
- /*
- ! * Record the CPU type.
- */
- lea pc@(_boot_info),a0
- movel a0@(BI_CPU),d6
-
- /*
- * Get address at end of kernel code/data/bss and
- --- 115,125 ----
- bsr Lserial_putc
-
- /*
- ! * Record the CPU and machine type.
- */
- lea pc@(_boot_info),a0
- movel a0@(BI_CPU),d6
- + movel a0@(BI_MACH),d4
-
- /*
- * Get address at end of kernel code/data/bss and
- ***************
- *** 192,198 ****
- bnes 1f
-
- /* 680[23]0 */
- ! lea pc@(_start),a1 /* base address */
- addql #PAGEDESC,a1 /* descriptor type */
- movel #0x40000,d2 /* increment */
- bras 2f
- --- 197,203 ----
- bnes 1f
-
- /* 680[23]0 */
- ! lea pc@(_start:w),a1 /* base address */
- addql #PAGEDESC,a1 /* descriptor type */
- movel #0x40000,d2 /* increment */
- bras 2f
- ***************
- *** 264,272 ****
- /*
- * Do any machine specific page table initializations.
- */
- - lea pc@(_boot_info),a0
- moveq #MACH_AMIGA,d0
- ! cmpl a0@(BI_MACH),d0
- bne Lnotami
-
- /*
- --- 269,276 ----
- /*
- * Do any machine specific page table initializations.
- */
- moveq #MACH_AMIGA,d0
- ! cmpl d4,d0
- bne Lnotami
-
- /*
- ***************
- *** 352,358 ****
- * noncachable/serialized.
- */
- movel a3,d0 /* ami page table start address */
- ! lea pc@(_start),a0
- subl a0,d0 /* determine offset of root table page */
- moveq #12,d1 /* determine offset into kernel page table */
- lsrl d1,d0
- --- 356,362 ----
- * noncachable/serialized.
- */
- movel a3,d0 /* ami page table start address */
- ! lea pc@(_start:w),a0
- subl a0,d0 /* determine offset of root table page */
- moveq #12,d1 /* determine offset into kernel page table */
- lsrl d1,d0
- ***************
- *** 371,376 ****
- --- 375,432 ----
-
- Lnotami: /* other machines specific mappings go here! */
-
- + moveq #MACH_ATARI,d0
- + cmpl d4,d0
- + bne Lnotatari
- +
- + /* On the Atari, duplicate the i/o region at 0xffffxxxxx and
- + mark it non-cachable, set up an identity translation of the first
- + 16M. We need two additional page tables for this */
- +
- + lea a5@(1024),a0
- + addl #2,a0
- + movel a0,a5@(508) /* 0xFE000000 - 0xFFFFFFFF */
- +
- + lea a5@(1024),a0
- + movel #0,d0
- + movel #63,d2
- + 1: movel d0,a0@+
- + dbra d2,1b
- +
- + /* Identity mapping of the last 16M of virtual address space
- + to the first 16M for efficient addressing of hardware registers */
- + movel #0x40000,d1
- + movel #63,d2
- + movel #PAGEDESC,d0
- + 1: movel d0,a0@+
- + addl d1,d0
- + dbra d2,1b
- + moveq #0x40,d0 /* make non-cachable */
- + addl d0,a5@(1532) /* 0xFFFC0000-0xFFFFFFFF (I/O space) */
- +
- + lea a5@(1536+TABLEDESC),a0
- + movel a0,a5@
- +
- + /* Identity mapping of the first 16M of virtual address space */
- + lea a5@(1536),a0
- + movel #PAGEDESC,d0
- + movel #0x40000,d1
- + movel #63,d2
- + 1: movel d0,a0@+
- + addl d1,d0
- + dbra d2,1b
- + /* 0x00FC0000 - 0x00FFFFFF (I/O space) uncachable */
- + movel #0x40,d0
- + addl d0,a0@(-4)
- +
- + movel #0,d0
- + movel #63,d2
- + 1: movel d0,a0@+
- + dbra d2,1b
- +
- + bra Lmapphys
- +
- + Lnotatari:
- /*
- * Setup a transparent mapping of the physical memory we are executing in.
- *
- ***************
- *** 383,390 ****
-
- clrl d5 /* indicate that no cleanup is required */
-
- ! lea pc@(_boot_info),a0
- ! cmpl #MACH_AMIGA,a0@(BI_MACH)
- bnes Lnophys /* other machines will probably have
- * to put in code and jump to it here
- */
- --- 439,445 ----
-
- clrl d5 /* indicate that no cleanup is required */
-
- ! cmpl #MACH_AMIGA,d4
- bnes Lnophys /* other machines will probably have
- * to put in code and jump to it here
- */
- ***************
- *** 403,409 ****
- */
-
- 2:
- ! lea pc@(_start),a0 /* get address of start of memory */
- cmpl a0,d0 /* compare limit to start */
- bhi Lnophys
-
- --- 458,464 ----
- */
-
- 2:
- ! lea pc@(_start:w),a0 /* get address of start of memory */
- cmpl a0,d0 /* compare limit to start */
- bhi Lnophys
-
- ***************
- *** 419,425 ****
- * in the root table. a0 contains the start address of the
- * kernel.
- */
- ! lea pc@(_start),a0
- movel a0,d2
- moveq #25,d3 /* find appropriate index in root table */
- lsrl d3,d2
- --- 474,480 ----
- * in the root table. a0 contains the start address of the
- * kernel.
- */
- ! lea pc@(_start:w),a0
- movel a0,d2
- moveq #25,d3 /* find appropriate index in root table */
- lsrl d3,d2
- ***************
- *** 434,440 ****
- * registers to identity map the 16M chunk that contains
- * the physical memory.
- */
- ! lea pc@(_start),a0
- movel a0,d2
- andl #0xff000000,d2 /* logical address base */
- orw #0xc040,d2 /* add in magic bits */
- --- 489,495 ----
- * registers to identity map the 16M chunk that contains
- * the physical memory.
- */
- ! lea pc@(_start:w),a0
- movel a0,d2
- andl #0xff000000,d2 /* logical address base */
- orw #0xc040,d2 /* add in magic bits */
- ***************
- *** 442,447 ****
- --- 497,532 ----
- .long 0x4e7b2006 /* movec d2,dttr0 */
-
- Lnophys:
- + cmpl #MACH_ATARI,d4
- + bnes Lnophys2
- +
- + /* if kernel runs in tt-ram, identity map its address space,
- + to be removed later */
- +
- + lea pc@(_start:w),a1
- + cmpl #0x1000000,a1
- + bcs Lnophys2
- +
- + /* cleanup is needed; note it */
- + moveq #1,d5
- +
- + /* this assumes that the kernel is in the first 12M of tt-ram,
- + otherwise we would have to set up an additional pointer table */
- + movel a1,d2
- + moveq #18,d3 /* find appropriate index in pointer table */
- + lsrl d3,d2
- + movel d2,d0
- + lsll d3,d0 /* convert address into descriptor */
- + addql #PAGEDESC,d0
- + movel #1<<18,d1
- + lea a5@(1536),a0
- + lea a0@(d2:l:4),a0
- + moveq #15,d2
- + 1: movel d0,a0@+ /* store mapping */
- + addl d1,d0
- + dbra d2,1b
- +
- + Lnophys2:
-
- /*
- * Setup Supervisor Root Pointer register to point to page directory,
- ***************
- *** 488,494 ****
- bsr Lserial_putc
-
- movel #KSTART_ADDR,d0
- ! lea pc@(_start),a0
-
- movel _kpt,d1
- subl a0,d1
- --- 573,579 ----
- bsr Lserial_putc
-
- movel #KSTART_ADDR,d0
- ! lea pc@(_start:w),a0
-
- movel _kpt,d1
- subl a0,d1
- ***************
- *** 520,527 ****
- lea pc@(tmp_fault_handler),a0
- move.l a0,8 /* Access fault vector */
-
- ! lea pc@(_start),a0
- ! jmp Lvirt
-
- Lvirt:
- moveq #'N',d7
- --- 605,612 ----
- lea pc@(tmp_fault_handler),a0
- move.l a0,8 /* Access fault vector */
-
- ! lea pc@(_start:w),a0
- ! jmp Lvirt:l
-
- Lvirt:
- moveq #'N',d7
- ***************
- *** 538,548 ****
- --- 623,652 ----
- bnes Loff040
-
- /* clean up physical identity mapping for 68020/68030 */
- + cmpl #MACH_AMIGA,d4
- + bne Lnoamiclean
- +
- movel a0,d2 /* a0 contains physical start address */
- moveq #25,d3 /* find appropriate index in root table */
- lsrl d3,d2
- moveq #0,d0
- movel d0,a5@(d2:l:4) /* clear descriptor */
- +
- + Lnoamiclean:
- +
- + cmpl #MACH_ATARI,d4
- + bne Lnoclean
- +
- + movel a0,d2 /* a0 contains physical start address */
- + moveq #18,d3 /* find appropriate index in pointer table */
- + lsrl d3,d2
- + moveq #0,d0
- + lea a5@(1536),a1
- + lea a1@(d2:l:4),a1
- + moveq #15,d5
- + 1: movel d0,a1@+ /* clear descriptor */
- + dbra d5,1b
- +
- pflusha /* flush address translation cache */
- bras Lnoclean
-
- ***************
- *** 633,662 ****
- LSERIAL_CNTRL = 0xbfd000
- LSERIAL_DTR = 7
-
-
- /*
- * Initialize serial port hardware for 9600/8/1
- */
- .even
- Lserial_init:
- ! lea pc@(_boot_info),a0
- ! cmpil #MACH_AMIGA,a0@(BI_MACH)
- bnes 1f
- bclr #LSERIAL_DTR,LSERIAL_CNTRL
- movew #LNTSC_PERIOD,LSERPER
- cmpl #LNTSC_ECLOCK,a0@(BI_AMIGA_ECLK)
- ! beqs 1f
- movew #LPAL_PERIOD,LSERPER
- ! 1: rts
-
- /*
- * Output character in d7 on serial port.
- ! * d7 unchanged.
- */
- Lserial_putc:
- movel a0,sp@-
- ! lea pc@(_boot_info),a0
- ! cmpil #MACH_AMIGA,a0@(BI_MACH)
- bnes 2f
- andw #0x00ff,d7
- oriw #0x0100,d7
- --- 737,850 ----
- LSERIAL_CNTRL = 0xbfd000
- LSERIAL_DTR = 7
-
- + /*
- + * Debug output support
- + * Atarians have a choice between the parallel port, the serial port
- + * from the MFP or a serial port of the SCC
- + */
- +
- + /* #define USE_PRINTER */
- + /* #define USE_SCC */
- + #define USE_MFP
- +
- + #ifdef USE_PRINTER
- +
- + LPSG_SELECT = 0xff8800
- + LPSG_READ = 0xff8800
- + LPSG_WRITE = 0xff8802
- + LPSG_IO_A = 14
- + LPSG_IO_B = 15
- + LPSG_CONTROL = 7
- + LSTMFP_GPIP = 0xfffa01
- + LSTMFP_DDR = 0xfffa05
- + LSTMFP_IERB = 0xfffa09
- +
- + #elif defined(USE_SCC)
- +
- + LSCC_CTRL_B = 0xff8c85
- + LSCC_DATA_B = 0xff8c87
- +
- + /* Initialisation table for SCC */
- + scc_initable:
- + .byte 9,12 /* Reset */
- + .byte 4,0x44 /* x16, 1 stopbit, no parity */
- + .byte 3,0xc0 /* receiver: 8 bpc */
- + .byte 5,0xe2 /* transmitter: 8 bpc, assert dtr/rts */
- + .byte 9,0 /* no interrupts */
- + .byte 10,0 /* NRZ */
- + .byte 11,0x50 /* use baud rate generator */
- + .byte 12,24,13,0 /* 9600 baud */
- + .byte 14,2,14,3 /* use master clock for BRG, enable */
- + .byte 3,0xc1 /* enable receiver */
- + .byte 5,0xea /* enable transmitter */
- + .byte -1
- + .even
- +
- + #elif defined(USE_MFP)
- +
- + LMFP_UCR = 0xfffa29
- + LMFP_TDCDR = 0xfffa1d
- + LMFP_TDDR = 0xfffa25
- + LMFP_TSR = 0xfffa2d
- + LMFP_UDR = 0xfffa2f
- +
- + #endif
-
- /*
- * Initialize serial port hardware for 9600/8/1
- + * a0 thrashed
- + * Atari d0 trashed (a1 in case of SCC)
- */
- .even
- Lserial_init:
- ! cmpil #MACH_AMIGA,d4
- bnes 1f
- bclr #LSERIAL_DTR,LSERIAL_CNTRL
- movew #LNTSC_PERIOD,LSERPER
- cmpl #LNTSC_ECLOCK,a0@(BI_AMIGA_ECLK)
- ! beqs 9f
- movew #LPAL_PERIOD,LSERPER
- ! bra 9f
- ! 1: cmpil #MACH_ATARI,d4
- ! bne 9f
- ! #ifdef USE_PRINTER
- ! bclr #0,LSTMFP_IERB
- ! bclr #0,LSTMFP_DDR
- ! moveb #LPSG_CONTROL,LPSG_SELECT
- ! moveb #0xff,LPSG_WRITE
- ! moveb #LPSG_IO_B,LPSG_SELECT
- ! clrb LPSG_WRITE
- ! moveb #LPSG_IO_A,LPSG_SELECT
- ! moveb LPSG_READ,d0
- ! bset #5,d0
- ! moveb d0,LPSG_WRITE
- ! #elif defined(USE_SCC)
- ! lea LSCC_CTRL_B,a0
- ! lea pc@(scc_initable:w),a1
- ! 2: moveb a1@+,d0
- ! jmi 3f
- ! moveb d0,a0@
- ! moveb a1@+,a0@
- ! jra 2b
- ! 3: clrb a0@
- ! #elif defined(USE_MFP)
- ! bclr #1,LMFP_TSR
- ! moveb #0x88,LMFP_UCR
- ! andb #0x70,LMFP_TDCDR
- ! moveb #2,LMFP_TDDR
- ! orb #1,LMFP_TDCDR
- ! bset #1,LMFP_TSR
- ! #endif
- ! 9:
- ! rts
-
- /*
- * Output character in d7 on serial port.
- ! * d7 thrashed.
- */
- Lserial_putc:
- movel a0,sp@-
- ! cmpil #MACH_AMIGA,d4
- bnes 2f
- andw #0x00ff,d7
- oriw #0x0100,d7
- ***************
- *** 664,670 ****
- 1: movew LSERDATR,d7
- andw #0x2000,d7
- beq 1b
- ! 2: movel sp@+,a0
- rts
-
- /*
- --- 852,884 ----
- 1: movew LSERDATR,d7
- andw #0x2000,d7
- beq 1b
- ! bra 9f
- ! 2: cmpil #MACH_ATARI,d4
- ! jne 9f
- ! #ifdef USE_PRINTER
- ! 3: btst #0,LSTMFP_GPIP
- ! jne 3b
- ! moveb #LPSG_IO_B,LPSG_SELECT
- ! moveb d7,LPSG_WRITE
- ! moveb #LPSG_IO_A,LPSG_SELECT
- ! moveb LPSG_READ,d7
- ! bclr #5,d7
- ! moveb d7,LPSG_WRITE
- ! nop
- ! nop
- ! bset #5,d7
- ! moveb d7,LPSG_WRITE
- ! #elif defined(USE_SCC)
- ! 3: btst #2,LSCC_CTRL_B
- ! jeq 3b
- ! moveb d7,LSCC_DATA_B
- ! #elif defined(USE_MFP)
- ! 3: btst #7,LMFP_TSR
- ! jeq 3b
- ! moveb d7,LMFP_UDR
- ! #endif
- ! 9:
- ! movel sp@+,a0
- rts
-
- /*
- ***************
- *** 698,716 ****
- addb #'0',d7
- bras 2f
- 1: addb #'A'-10,d7
- ! 2: bsrs Lserial_putc
- dbra d2,L1
- moveq #32,d7
- ! bsrs Lserial_putc
- moveml sp@+,d0-d2/d7
- rts
- .globl showtest
- showtest:
- moveml a1/d7,sp@-
- moveq #'A',d7
- ! bsrs Lserial_putc
- moveq #'=',d7
- ! bsrs Lserial_putc
- movel a0,d7
- bsrs Lserial_putnum
-
- --- 912,930 ----
- addb #'0',d7
- bras 2f
- 1: addb #'A'-10,d7
- ! 2: bsr Lserial_putc
- dbra d2,L1
- moveq #32,d7
- ! bsr Lserial_putc
- moveml sp@+,d0-d2/d7
- rts
- .globl showtest
- showtest:
- moveml a1/d7,sp@-
- moveq #'A',d7
- ! bsr Lserial_putc
- moveq #'=',d7
- ! bsr Lserial_putc
- movel a0,d7
- bsrs Lserial_putnum
-
- diff -cr --new-file linux-0.9pl1/m68k/ints.c linux-0.9pl2/m68k/ints.c
- *** linux-0.9pl1/m68k/ints.c Sun Jun 26 15:30:24 1994
- --- linux-0.9pl2/m68k/ints.c Fri Aug 5 12:47:20 1994
- ***************
- *** 13,27 ****
- #include <linux/interrupt.h>
- #include <linux/sched.h>
-
- - /*
- - * ++roman: The number of possible interrupts is 7 only if there are no
- - * non-autovec ints. But e.g. the Atari uses a lot of them. So I defined
- - * a constant NUM_INT_SOURCES in interrupt.h that gives the total number of
- - * possible interrputs. A constant FIRST_NONAUTO_VEC is defined also.
- - */
- -
- /* list is accessed 0-6 for IRQs 1-7 */
- ! static isr_node_t *isr_list[NUM_INT_SOURCES];
-
- /* The number of spurious interrupts */
- volatile unsigned long num_spurious;
- --- 13,20 ----
- #include <linux/interrupt.h>
- #include <linux/sched.h>
-
- /* list is accessed 0-6 for IRQs 1-7 */
- ! static isr_node_t *isr_list[7];
-
- /* The number of spurious interrupts */
- volatile unsigned long num_spurious;
- ***************
- *** 47,53 ****
- int i;
-
- /* initialize the ISR list pointers */
- ! for (i = 0; i < NUM_INT_SOURCES; i++)
- isr_list[i] = NULL;
-
- num_spurious = 0;
- --- 40,46 ----
- int i;
-
- /* initialize the ISR list pointers */
- ! for (i = 0; i < 7; i++)
- isr_list[i] = NULL;
-
- num_spurious = 0;
- ***************
- *** 133,139 ****
- {
- isr_node_t *np;
-
- ! static isr_node_t nodes[32];
- static int curnode = 0;
-
- np = &nodes[curnode++];
- --- 126,132 ----
- {
- isr_node_t *np;
-
- ! static isr_node_t nodes[100];
- static int curnode = 0;
-
- np = &nodes[curnode++];
- ***************
- *** 152,158 ****
- return mach_add_isr (source, isr, pri, data);
- }
-
- ! if (source < IRQ1 || source > NUM_INT_SOURCES)
- panic ("add_isr: Incorrect IRQ source");
-
- p = new_isr_node();
- --- 145,151 ----
- return mach_add_isr (source, isr, pri, data);
- }
-
- ! if (source < IRQ1 || source > IRQ7)
- panic ("add_isr: Incorrect IRQ source");
-
- p = new_isr_node();
- ***************
- *** 183,199 ****
- static int last_spur = 0;
- #endif
-
- - #if NUM_INT_SOURCES > 7
- - /* Possibility for non-autovec ints! */
- - if (level < 8)
- - /* autovector int */
- - call_isr_list (isr_list[level-1], fp);
- - else
- - /* non-autovec */
- - call_isr_list (isr_list[level-FIRST_NONAUTO_VEC+24+7], fp);
- - #else
- call_isr_list (isr_list[level-1], fp);
- - #endif
-
- #ifdef DEBUG_LOST_INT_DECR
- if (cnt != intr_count) {
- --- 176,182 ----
- diff -cr --new-file linux-0.9pl1/m68k/ptrace.c linux-0.9pl2/m68k/ptrace.c
- *** linux-0.9pl1/m68k/ptrace.c Tue Jun 7 19:38:44 1994
- --- linux-0.9pl2/m68k/ptrace.c Fri Aug 5 12:46:34 1994
- ***************
- *** 17,22 ****
- --- 17,24 ----
- #include <linux/ptrace.h>
- #include <linux/errno.h>
- #include <linux/bootinfo.h>
- + #include <linux/user.h>
- + #include <linux/stddef.h>
-
- /*
- * This routine gets a long from any process space by following the page
- ***************
- *** 123,132 ****
- if (addr > TASK_SIZE-sizeof(long))
- return -EIO;
- if ((addr & ~PAGE_MASK) > PAGE_SIZE-sizeof(long)) {
- ! low = get_long(tsk,addr & ~(sizeof(long)-1));
- ! high = get_long(tsk,(addr+sizeof(long)) & ~(sizeof(long)-1));
- switch (addr & (sizeof(long)-1)) {
- ! case 1:
- low >>= 8;
- low |= high << 24;
- break;
- --- 125,134 ----
- if (addr > TASK_SIZE-sizeof(long))
- return -EIO;
- if ((addr & ~PAGE_MASK) > PAGE_SIZE-sizeof(long)) {
- ! high = get_long(tsk,addr & ~(sizeof(long)-1));
- ! low = get_long(tsk,(addr+sizeof(long)) & ~(sizeof(long)-1));
- switch (addr & (sizeof(long)-1)) {
- ! case 3:
- low >>= 8;
- low |= high << 24;
- break;
- ***************
- *** 134,140 ****
- low >>= 16;
- low |= high << 16;
- break;
- ! case 3:
- low >>= 24;
- low |= high << 8;
- break;
- --- 136,142 ----
- low >>= 16;
- low |= high << 16;
- break;
- ! case 1:
- low >>= 24;
- low |= high << 8;
- break;
- ***************
- *** 156,168 ****
- if (addr > TASK_SIZE-sizeof(long))
- return -EIO;
- if ((addr & ~PAGE_MASK) > PAGE_SIZE-sizeof(long)) {
- ! low = get_long(tsk,addr & ~(sizeof(long)-1));
- ! high = get_long(tsk,(addr+sizeof(long)) & ~(sizeof(long)-1));
- switch (addr & (sizeof(long)-1)) {
- case 0: /* shouldn't happen, but safety first */
- ! low = data;
- break;
- ! case 1:
- low &= 0x000000ff;
- low |= data << 8;
- high &= ~0xff;
- --- 158,170 ----
- if (addr > TASK_SIZE-sizeof(long))
- return -EIO;
- if ((addr & ~PAGE_MASK) > PAGE_SIZE-sizeof(long)) {
- ! high = get_long(tsk,addr & ~(sizeof(long)-1));
- ! low = get_long(tsk,(addr+sizeof(long)) & ~(sizeof(long)-1));
- switch (addr & (sizeof(long)-1)) {
- case 0: /* shouldn't happen, but safety first */
- ! high = data;
- break;
- ! case 3:
- low &= 0x000000ff;
- low |= data << 8;
- high &= ~0xff;
- ***************
- *** 174,188 ****
- high &= ~0xffff;
- high |= data >> 16;
- break;
- ! case 3:
- low &= 0x00ffffff;
- low |= data << 24;
- high &= ~0xffffff;
- high |= data >> 8;
- break;
- }
- ! put_long(tsk,addr & ~(sizeof(long)-1),low);
- ! put_long(tsk,(addr+sizeof(long)) & ~(sizeof(long)-1),high);
- } else
- put_long(tsk,addr,data);
- return 0;
- --- 176,190 ----
- high &= ~0xffff;
- high |= data >> 16;
- break;
- ! case 1:
- low &= 0x00ffffff;
- low |= data << 24;
- high &= ~0xffffff;
- high |= data >> 8;
- break;
- }
- ! put_long(tsk,addr & ~(sizeof(long)-1),high);
- ! put_long(tsk,(addr+sizeof(long)) & ~(sizeof(long)-1),low);
- } else
- put_long(tsk,addr,data);
- return 0;
- ***************
- *** 193,199 ****
- unsigned long tmp;
- int res;
-
- ! if ((addr & 3) || addr < 0 || addr > 18*sizeof(long))
- return -EIO;
-
- res = verify_area(VERIFY_WRITE, (void *) data, sizeof(long));
- --- 195,201 ----
- unsigned long tmp;
- int res;
-
- ! if ((addr & 3) || addr < 0 || addr >= sizeof(struct user))
- return -EIO;
-
- res = verify_area(VERIFY_WRITE, (void *) data, sizeof(long));
- ***************
- *** 206,218 ****
- if (addr == PT_SR)
- tmp &= 0xffff;
- }
- put_fs_long(tmp,(unsigned long *) data);
- return 0;
- }
-
- int ptrace_pokeusr(struct task_struct *tsk, long addr, long data)
- {
- ! if ((addr & 3) || addr < 0 || addr > 18*sizeof(long))
- return -EIO;
-
- addr = addr >> 2; /* temporary hack. */
- --- 208,230 ----
- if (addr == PT_SR)
- tmp &= 0xffff;
- }
- + else if (addr >= offsetof (struct user, m68kfp)
- + && addr < (offsetof (struct user, m68kfp)
- + + sizeof (struct user_m68kfp_struct)))
- + {
- + addr -= offsetof (struct user, m68kfp);
- + addr >>= 2;
- + tmp = tsk->tss.fpregs[addr];
- + }
- + else
- + return -EIO;
- put_fs_long(tmp,(unsigned long *) data);
- return 0;
- }
-
- int ptrace_pokeusr(struct task_struct *tsk, long addr, long data)
- {
- ! if ((addr & 3) || addr < 0 || addr >= sizeof(struct user))
- return -EIO;
-
- addr = addr >> 2; /* temporary hack. */
- ***************
- *** 223,234 ****
- data &= SR_MASK;
- data |= ptrace_get_stack_long(tsk, PT_SR*sizeof(long)) & ~SR_MASK;
- }
- - /* Do not allow the user to set the debug register for kernel
- - address space */
- if(addr < 19){
- if (ptrace_put_stack_long(tsk, sizeof(long)*addr, data))
- return -EIO;
- return 0;
- };
- return -EIO;
- }
- --- 235,252 ----
- data &= SR_MASK;
- data |= ptrace_get_stack_long(tsk, PT_SR*sizeof(long)) & ~SR_MASK;
- }
- if(addr < 19){
- if (ptrace_put_stack_long(tsk, sizeof(long)*addr, data))
- return -EIO;
- return 0;
- };
- + if (addr >= offsetof (struct user, m68kfp) >> 2
- + && addr < (offsetof (struct user, m68kfp)
- + + sizeof (struct user_m68kfp_struct)) >> 2)
- + {
- + addr -= offsetof (struct user, m68kfp) >> 2;
- + tsk->tss.fpregs[addr] = data;
- + return 0;
- + }
- return -EIO;
- }
- diff -cr --new-file linux-0.9pl1/m68k/sys_call.S linux-0.9pl2/m68k/sys_call.S
- *** linux-0.9pl1/m68k/sys_call.S Sun Jun 26 15:32:26 1994
- --- linux-0.9pl2/m68k/sys_call.S Fri Aug 5 12:47:20 1994
- ***************
- *** 156,162 ****
- movel sp,a0@(LESP0_OFFSET)
-
- cmpl _NR_syscalls,d0
- ! bgt _ret_from_exception
- andw #~LCF_MASK,sp@(LOFF_SR) | assume syscall success
- clrl a0@(LTS_ERRNO)
- btst #5,a0@(LTS_FLAGS+3) | PF_TRACESYS
- --- 156,162 ----
- movel sp,a0@(LESP0_OFFSET)
-
- cmpl _NR_syscalls,d0
- ! bhi _ret_from_exception
- andw #~LCF_MASK,sp@(LOFF_SR) | assume syscall success
- clrl a0@(LTS_ERRNO)
- btst #5,a0@(LTS_FLAGS+3) | PF_TRACESYS
- ***************
- *** 238,243 ****
- --- 238,244 ----
-
- /*
- ** This is the main interrupt handler, responsible for calling process_int()
- + ** or (*mach_process_int)(), if it is a non-autovector int.
- */
- _inthandler:
- moveml a0-a1/d0-d1,sp@- | save registers
- ***************
- *** 246,268 ****
- movew sp@(22),d0 | put exception # in d0
- andil #0xfff,d0 | mask out format nybble
-
- ! subil #0x60,d0 | convert from vector offset...
- lsrl #2,d0 | ...to IRQ number
-
- beq Lspurious | if zero, spurious interrupt
- ! | the following two lines were replaced by the one after for the Atari
- ! | movec msp,a0 | push interrupt stack frame address
- ! | movel a0,sp@-
- ! pea sp@ | push interrupt stack frame address
- movel d0,sp@- | put IRQ # on stack
- jbsr _process_int | process the IRQ
- addql #8,sp | pop parameters off stack
-
- ! subql #1,_intr_count
-
-
- /* maybe process software interrupts */
- ! tstl _intr_count
- bne 1f
-
- movel _bh_mask,d0
- --- 247,283 ----
- movew sp@(22),d0 | put exception # in d0
- andil #0xfff,d0 | mask out format nybble
-
- ! cmpw #0x100,d0 | check if user interrupt
- ! bge Luserint
- !
- ! subiw #0x60,d0 | convert from vector offset...
- lsrl #2,d0 | ...to IRQ number
-
- beq Lspurious | if zero, spurious interrupt
- ! movec msp,a0 | push interrupt stack frame address
- ! movel a0,sp@-
- movel d0,sp@- | put IRQ # on stack
- jbsr _process_int | process the IRQ
- addql #8,sp | pop parameters off stack
- + jra 1f
- + Luserint:
- + movel _mach_process_int,a1
- + tstl a1 | if no hook installed
- + beq Lspurious | ... then spurious interrupt
- +
- + subiw #0x100,d0 | convert from vector offset...
- + lsrl #2,d0 | ...to IRQ number
- + movec msp,a0 | push interrupt stack frame address
- + movel a0,sp@-
- + movel d0,sp@- | put IRQ # on stack
- + jsr a1@ | process the IRQ
- + addql #8,sp | pop parameters off stack
-
- ! 1:
-
-
- /* maybe process software interrupts */
- ! subql #1,_intr_count
- bne 1f
-
- movel _bh_mask,d0
- diff -cr --new-file linux-0.9pl1/m68k/traps.c linux-0.9pl2/m68k/traps.c
- *** linux-0.9pl1/m68k/traps.c Thu Jul 7 19:23:54 1994
- --- linux-0.9pl2/m68k/traps.c Fri Aug 5 12:46:35 1994
- ***************
- *** 579,586 ****
- printk("PC: %08lx\nSR: %04x\n", fp->pc,fp->sr);
- if (STACK_MAGIC != *(unsigned long *)current->kernel_stack_page)
- printk("Corrupted stack page\n");
- ! printk("Process %s (pid: %d, process nr: %d, stackpage=%08lx)\nStack: ",
- ! current->comm, current->pid, 0xffff & i, current->kernel_stack_page);
- for (i = 0; i < 10; i++)
- printk ("%02x ", 0xff & ssp[i]);
- printk ("\n");
- --- 579,586 ----
- printk("PC: %08lx\nSR: %04x\n", fp->pc,fp->sr);
- if (STACK_MAGIC != *(unsigned long *)current->kernel_stack_page)
- printk("Corrupted stack page\n");
- ! printk("Process %s (pid: %d, stackpage=%08lx)\nStack: ",
- ! current->comm, current->pid, current->kernel_stack_page);
- for (i = 0; i < 10; i++)
- printk ("%02x ", 0xff & ssp[i]);
- printk ("\n");
- diff -cr --new-file linux-0.9pl1/mm/memory.c linux-0.9pl2/mm/memory.c
- *** linux-0.9pl1/mm/memory.c Sat Jun 25 18:52:56 1994
- --- linux-0.9pl2/mm/memory.c Fri Aug 5 12:46:37 1994
- ***************
- *** 557,563 ****
- free_pointer_table (ptrp);
- else if (!ptrp)
- return -ENOMEM;
- ! *rootp = VTOP(ptrp) | PAGE_TABLE;
- }
- ptrp = (unsigned long *)PTOV(*rootp & TABLE_MASK);
- ptrp += L2_INDEX(address);
- --- 557,564 ----
- free_pointer_table (ptrp);
- else if (!ptrp)
- return -ENOMEM;
- ! else
- ! *rootp = VTOP(ptrp) | PAGE_TABLE;
- }
- ptrp = (unsigned long *)PTOV(*rootp & TABLE_MASK);
- ptrp += L2_INDEX(address);
- ***************
- *** 620,626 ****
- free_pointer_table (ptrp);
- else if (!ptrp)
- return -ENOMEM;
- ! *rootp = VTOP(ptrp) | PAGE_TABLE;
- }
- ptrp = (unsigned long *)PTOV(*rootp & TABLE_MASK);
- ptrp += L2_INDEX(address);
- --- 621,628 ----
- free_pointer_table (ptrp);
- else if (!ptrp)
- return -ENOMEM;
- ! else
- ! *rootp = VTOP(ptrp) | PAGE_TABLE;
- }
- ptrp = (unsigned long *)PTOV(*rootp & TABLE_MASK);
- ptrp += L2_INDEX(address);
- diff -cr --new-file linux-0.9pl1/mm/swap.c linux-0.9pl2/mm/swap.c
- *** linux-0.9pl1/mm/swap.c Tue Jun 21 18:32:41 1994
- --- linux-0.9pl2/mm/swap.c Fri Aug 5 12:46:38 1994
- ***************
- *** 313,319 ****
-
- static int swap_out(unsigned int priority)
- {
- ! static int swap_task;
- int table;
- int page;
- long pg_table;
- --- 313,319 ----
-
- static int swap_out(unsigned int priority)
- {
- ! static int swap_task = 1;
- int table;
- int page;
- long pg_table;
- ***************
- *** 689,695 ****
- unsigned long tmp = 0;
- struct task_struct *p;
-
- ! nr = 0;
- /*
- * When we have to sleep, we restart the whole algorithm from the same
- * task we stopped in. That at least rids us of all races.
- --- 689,695 ----
- unsigned long tmp = 0;
- struct task_struct *p;
-
- ! nr = 1;
- /*
- * When we have to sleep, we restart the whole algorithm from the same
- * task we stopped in. That at least rids us of all races.
- diff -cr --new-file linux-0.9pl1/tools/atari/bootstrap.c linux-0.9pl2/tools/atari/bootstrap.c
- *** linux-0.9pl1/tools/atari/bootstrap.c Wed Dec 31 19:00:00 1969
- --- linux-0.9pl2/tools/atari/bootstrap.c Fri Aug 5 12:47:22 1994
- ***************
- *** 0 ****
- --- 1,558 ----
- + /*
- + ** bootstrap.c -- Load and launch the Atari Linux kernel
- + **
- + ** Copyright 1993 by Arjan Knor
- + **
- + ** This file is subject to the terms and conditions of the GNU General Public
- + ** License. See the file README.legal in the main directory of this archive
- + ** for more details.
- + **
- + ** History:
- + ** 19 Feb 1994 Changed everything so that it works? (rdv)
- + ** 14 Mar 1994 New mini-copy routine used (rdv)
- + */
- +
- + #include <stdio.h>
- + #include <stdlib.h>
- + #include <unistd.h>
- + #include <stddef.h>
- + #include <string.h>
- + #include "sysvars.h"
- + #include <osbind.h>
- + #include <sys/types.h>
- + #include <sys/file.h>
- +
- + /* linux specific include files */
- + #include <linux/a.out.h>
- + #include <linux/bootinfo.h>
- +
- + /* Atari bootstrap include file */
- + #include "bootstrap.h"
- +
- + #define MIN_RAMSIZE (3) /* 3 MB */
- + #define TEMP_STACKSIZE 256
- +
- + extern char *optarg;
- + extern int optind;
- + extern struct nlist *get_nlist(const char *fname, const char *symname);
- +
- + struct bootinfo bi;
- + u_long *cookiejar;
- + u_long userstk;
- +
- + /* getcookie -- function to get the value of the given cookie. */
- + static int getcookie(char *cookie, u_long *value)
- + {
- + int i = 0;
- +
- + while(cookiejar[i] != 0L) {
- + if(cookiejar[i] == *(u_long *)cookie) {
- + *value = cookiejar[i + 1];
- + return 1;
- + }
- + i += 2;
- + }
- + return -1;
- + }
- +
- + static void usage(void)
- + {
- + fprintf(stderr, "Usage:\n"
- + "\tbootstrap [-d] [-k kernel_executable] [-r ramdisk_file]"
- + " [option...]\n");
- + exit(EXIT_FAILURE);
- + }
- +
- + /*
- + * Copy the kernel and the ramdisk to their final resting places.
- + *
- + * I assume that the kernel data and the ramdisk reside somewhere
- + * in the middle of the memory.
- + *
- + * This program itself should be somewhere in the first 4096 bytes of memory
- + * where the kernel never will be. In this way it can never be overwritten
- + * by itself.
- + *
- + * At this point the registers have:
- + * a0: the start of the final kernel
- + * a1: the start of the current kernel
- + * a2: the end of the final ramdisk
- + * a3: the end of the current ramdisk
- + * d0: the kernel size
- + * d1: the ramdisk size
- + */
- + asm ("
- + .text
- + .globl _copyall, _copyallend
- + _copyall:
- +
- + movel a0,a4 /* save the start of the kernel for booting */
- +
- + 1: movel a1@+,a0@+ /* copy the kernel starting at the beginning */
- + subql #4,d0
- + jcc 1b
- +
- + 2: movel a3@-,a2@- /* copy the ramdisk starting at the end */
- + subql #4,d1
- + jcc 2b
- +
- + jmp a4@ /* jump to the start of the kernel */
- + _copyallend:
- + ");
- +
- + extern char copyall, copyallend;
- +
- + static void volatile boot_exit(int status)
- + {
- + /* first go back to user mode */
- + (void)Super(userstk);
- + exit(status);
- + }
- +
- + int main(int argc, char *argv[])
- + {
- + int debugflag = 0, ch, kfd, rfd = -1, lang, i;
- + char *ramdisk_name, *kernel_name, *memptr;
- + u_long ST_ramsize, TT_ramsize, memreq;
- + u_long cpu_type, fpu_type, mch_type, mint, language;
- + struct nlist *nl;
- + struct exec kexec;
- + OSHEADER *os_header;
- + u_long start_mem, mem_size, rd_size, kbi_offset;
- +
- + ramdisk_name = NULL;
- + kernel_name = "vmlinux";
- +
- + /* print the startup message */
- + puts("\fLinux/68k Atari Bootstrap version 0.2");
- + puts("Copyright 1993,1994 by Arjan Knor, Robert de Vries\n");
- +
- + /* machine is Atari */
- + bi.machtype = MACH_ATARI;
- +
- + /* check arguments */
- + while ((ch = getopt(argc, argv, "dk:r:")) != EOF)
- + switch (ch) {
- + case 'd':
- + debugflag = 1;
- + break;
- + case 'k':
- + kernel_name = optarg;
- + break;
- + case 'r':
- + ramdisk_name = optarg;
- + break;
- + case '?':
- + default:
- + usage();
- + }
- +
- + argc -= optind;
- + argv += optind;
- +
- + /* We have to access some system variables to get
- + * the information we need, so we must switch to
- + * supervisor mode first.
- + */
- + userstk = Super(0L);
- +
- + /* get the info we need from the cookie-jar */
- + cookiejar = *_p_cookies;
- + if(cookiejar == 0L) {
- + /* if we find no cookies, it's probably an ST */
- + fprintf(stderr, "Error: No cookiejar found. Is this an ST?\n");
- + boot_exit(EXIT_FAILURE);
- + }
- +
- + /* Exit if MiNT/MultiTOS is running. */
- + if(getcookie("MiNT", &mint) != -1)
- + {
- + puts("Warning: MiNT is running\n");
- + #if 0
- + puts("Linux cannot be started when MiNT is running. Aborting...\n");
- + boot_exit(EXIT_FAILURE);
- + #endif
- + }
- +
- + /* get _CPU, _FPU and _MCH */
- + getcookie("_CPU", &cpu_type);
- + getcookie("_FPU", &fpu_type);
- + getcookie("_MCH", &mch_type);
- +
- + /* First determine what machine we are on */
- + mch_type = mch_type >> 16;
- + printf("Machine = ");
- + switch(mch_type)
- + {
- + case MACH_ST:
- + puts("ST\n");
- + break;
- + case MACH_STE:
- + puts("STE\n");
- + break;
- + case MACH_TT:
- + puts("TT\n");
- + break;
- + case MACH_FALCON:
- + puts("Falcon\n");
- + break;
- + default:
- + printf("UNKNOWN (%ld)\n\n", mch_type);
- + break;
- + }
- +
- + /* check if we are on a 68030 */
- + if (cpu_type != 30)
- + {
- + puts("Machine type currently not supported. Aborting...");
- + boot_exit(EXIT_FAILURE);
- + }
- +
- + switch(cpu_type) {
- + case 0:
- + case 10: break;
- + case 20: bi.cputype = CPU_68020; break;
- + case 30: bi.cputype = CPU_68030; break;
- + case 40: bi.cputype = CPU_68040; break;
- + default:
- + fprintf(stderr, "Error: Unknown CPU type. Aborting...\n");
- + boot_exit(EXIT_FAILURE);
- + break;
- + }
- +
- + printf("CPU: %ld; ", cpu_type + 68000);
- + printf("FPU: ");
- +
- + /* check for FPU */
- + switch(fpu_type >> 16)
- + {
- + case 0:
- + puts("not present\n");
- + break;
- + case 2:
- + /* try to determine real type */
- + if (fpu_idle_frame_size () != 0x18)
- + goto m68882;
- + /* fall through */
- + case 4:
- + bi.cputype |= FPU_68881;
- + puts("68881\n");
- + break;
- + case 6:
- + m68882:
- + bi.cputype |= FPU_68882;
- + puts("68882\n");
- + break;
- + default:
- + puts("Unknown FPU type. Assuming no FPU.");
- + break;
- + }
- +
- + if (mch_type == MACH_TT)
- + bi.bi_atari.model = ATARI_TT;
- + else if (mch_type == MACH_FALCON)
- + bi.bi_atari.model = ATARI_FALCON;
- + else if ((mch_type == MACH_STE) && (cpu_type == 30))
- + bi.bi_atari.model = ATARI_FALCON; /* this is for my beta-falcon (rdv) */
- + else
- + {
- + fprintf(stderr, "Error: unsupported atari type. Aborting...\n");
- + boot_exit(EXIT_FAILURE);
- + }
- +
- + /* Get the amounts of ST- and TT-RAM. */
- + /* The size must be a multiple of 1MB. */
- + i = 0;
- + TT_ramsize = 0;
- + if (mch_type == MACH_TT && *ramtop) {
- + /* the 'ramtop' variable at 0x05a4 is not
- + * officially documented. We use it anyway
- + * because it is the only way to get the TTram size.
- + * (It is zero if there is no TTram.)
- + */
- + bi.memory[i].addr = TT_RAM_BASE;
- + bi.memory[i].size = (*ramtop - TT_RAM_BASE) & ~(MB - 1);
- + TT_ramsize = bi.memory[i].size / MB;
- + i++;
- +
- + printf("TT-RAM: %ld Mb; ", TT_ramsize);
- + }
- +
- + bi.memory[i].addr = PAGE_SIZE; /* do not use the exception space
- + (this comes down to the first page) */
- + bi.memory[i].size = (*phystop - bi.memory[i].addr) & ~(MB - 1);
- + ST_ramsize = bi.memory[i].size / MB;
- +
- + bi.bi_atari.stram_start = bi.memory[i].addr + bi.memory[i].size;
- + bi.bi_atari.stram_size = *phystop - bi.bi_atari.stram_start;
- +
- + i++;
- +
- + printf("ST-RAM: %ld Mb; %ld Kb unmapped; ", ST_ramsize,
- + bi.bi_atari.stram_size / 1024);
- +
- + bi.num_memory = i;
- +
- + /* verify that there is enough RAM; ST- and TT-RAM combined */
- + if (ST_ramsize + TT_ramsize < MIN_RAMSIZE) {
- + puts("Not enough RAM. Aborting...");
- + boot_exit(10);
- + }
- +
- + /* Get language/keyboard info */
- + /* TODO: do we need this ? */
- + /* Could be used to auto-select keyboard map later on. (rdv) */
- + if (getcookie("_AKP",&language) == -1)
- + {
- + /* Get the language info from the OS-header */
- + os_header = *_sysbase;
- + os_header = os_header->os_beg;
- + lang = (os_header->os_conf) >> 1;
- + printf("Language: ");
- + switch(lang) {
- + case HOL: puts("Dutch"); break; /* Own country first :-) */
- + case USA: puts("American"); break;
- + case SWG: puts("Switzerland (German)"); break;
- + case FRG: puts("German"); break;
- + case FRA: puts("French"); break;
- + case SWF: puts("Switzerland (French)"); break;
- + case UK: puts("English"); break;
- + case SPA: puts("Spanish"); break;
- + case ITA: puts("Italian"); break;
- + case SWE: puts("Swedish"); break;
- + case TUR: puts("Turkey"); break;
- + case FIN: puts("Finnish"); break;
- + case NOR: puts("Norwegian"); break;
- + case DEN: puts("Danish"); break;
- + case SAU: puts("Saudi-Arabian"); break;
- + default: puts("Unknown"); break;
- + }
- + }
- + else
- + {
- + printf("Language: ");
- + switch(language & 0x0F)
- + {
- + case 1: printf("German "); break;
- + case 2: printf("French "); break;
- + case 4: printf("Spanish "); break;
- + case 5: printf("Italian "); break;
- + case 7: printf("Swiss French "); break;
- + case 8: printf("Swiss German "); break;
- + default: printf("English ");
- + }
- + printf("Keyboard type :");
- + switch(language >> 8)
- + {
- + case 1: printf("German "); break;
- + case 2: printf("French "); break;
- + case 4: printf("Spanish "); break;
- + case 5: printf("Italian "); break;
- + case 7: printf("Swiss French "); break;
- + case 8: printf("Swiss German "); break;
- + default: printf("English ");
- + }
- + printf("\n");
- + }
- +
- + /*
- + * Copy command line options into the kernel command line.
- + */
- + i = 0;
- + while (argc--) {
- + if ((i+strlen(*argv)+1) < CL_SIZE) {
- + i += strlen(*argv) + 1;
- + if (bi.command_line[0])
- + strcat (bi.command_line, " ");
- + strcat (bi.command_line, *argv++);
- + }
- + }
- + printf ("Command line is '%s'\n", bi.command_line);
- +
- + start_mem = bi.memory[0].addr;
- + mem_size = bi.memory[0].size;
- +
- + /* tell us where the kernel will go */
- + printf("\nThe kernel will be located at 0x%08lx\n", start_mem);
- +
- + #ifdef TEST
- + /*
- + ** Temporary exit point for testing
- + */
- + boot_exit(-1);
- + #endif /* TEST */
- +
- + /* open kernel executable and read exec header */
- + if ((kfd = open (kernel_name, O_RDONLY)) == -1) {
- + fprintf (stderr, "Unable to open kernel file %s\n", kernel_name);
- + boot_exit (EXIT_FAILURE);
- + }
- +
- + if (read (kfd, (void *)&kexec, sizeof(kexec)) != sizeof(kexec))
- + {
- + fprintf (stderr, "Unable to read exec header from %s\n", kernel_name);
- + boot_exit (EXIT_FAILURE);
- + }
- +
- + /* init ramdisk */
- + if(ramdisk_name) {
- + if((rfd = open(ramdisk_name, O_RDONLY)) == -1) {
- + fprintf(stderr, "Unable to open ramdisk file %s\n",
- + ramdisk_name);
- + boot_exit(EXIT_FAILURE);
- + }
- + bi.ramdisk_size = (lseek(rfd, 0, SEEK_END) + 1023) / 1024;
- + }
- + else
- + bi.ramdisk_size = 0;
- +
- + rd_size = bi.ramdisk_size << 10;
- + bi.ramdisk_addr = (u_long)start_mem + mem_size - rd_size;
- +
- + /* find offset to boot_info structure */
- + if (!(nl = get_nlist (kernel_name, "_boot_info")))
- + {
- + perror ("get_nlist");
- + boot_exit (EXIT_FAILURE);
- + }
- +
- + kbi_offset = nl->n_value - kexec.a_entry;
- + free (nl);
- +
- + /* calculate the total required amount of memory */
- + memreq = kexec.a_text + kexec.a_data + kexec.a_bss + rd_size;
- +
- + /* allocate RAM for the kernel */
- + if (!(memptr = (char *)Malloc (memreq)))
- + {
- + fprintf (stderr, "Unable to allocate memory\n");
- + boot_exit (EXIT_FAILURE);
- + }
- + else
- + fprintf(stderr, "kernel at address %lx\n", (u_long) memptr);
- +
- + (void)memset(memptr, 0, memreq);
- +
- + /* read the text and data segments from the kernel image */
- + if (lseek (kfd, N_TXTOFF(kexec), SEEK_SET) == -1)
- + {
- + fprintf (stderr, "Failed to seek to text\n");
- + Mfree ((void *)memptr);
- + boot_exit (EXIT_FAILURE);
- + }
- + if (read (kfd, memptr, kexec.a_text) != kexec.a_text)
- + {
- + fprintf (stderr, "Failed to read text\n");
- + Mfree ((void *)memptr);
- + boot_exit (EXIT_FAILURE);
- + }
- + if (lseek (kfd, N_DATOFF(kexec), SEEK_SET) == -1)
- + {
- + fprintf (stderr, "Failed to seek to data\n");
- + Mfree ((void *)memptr);
- + boot_exit (EXIT_FAILURE);
- + }
- + if (read (kfd, memptr + kexec.a_text, kexec.a_data) != kexec.a_data)
- + {
- + fprintf (stderr, "Failed to read data\n");
- + Mfree ((void *)memptr);
- + boot_exit (EXIT_FAILURE);
- + }
- + close (kfd);
- +
- + /* copy the boot_info struct to the kernel image */
- + memcpy ((void *)(memptr + kbi_offset), &bi, sizeof(bi));
- +
- + /* read the ramdisk image */
- + if (rfd != -1)
- + {
- + if (lseek (rfd, 0, SEEK_SET) == -1)
- + {
- + fprintf (stderr, "Failed to seek to beginning of ramdisk file\n");
- + Mfree ((void *)memptr);
- + boot_exit (EXIT_FAILURE);
- + }
- + if (read (rfd, memptr + kexec.a_text + kexec.a_data + kexec.a_bss,
- + rd_size) != rd_size)
- + {
- + fprintf (stderr, "Failed to read ramdisk file\n");
- + Mfree ((void *)memptr);
- + boot_exit (EXIT_FAILURE);
- + }
- + close (rfd);
- + }
- +
- + /* for those who want to debug */
- + if (debugflag)
- + {
- + if (bi.ramdisk_size)
- + printf ("RAM disk at %#lx, size is %ldK\n",
- + (u_long)memptr + kexec.a_text + kexec.a_data + kexec.a_bss,
- + bi.ramdisk_size);
- +
- + printf ("\nKernel text at %#lx, code size %d\n",
- + start_mem + N_TXTADDR(kexec), kexec.a_text);
- + printf ("Kernel data at %#lx, data size %d\n",
- + start_mem + N_DATADDR(kexec), kexec.a_data );
- + printf ("Kernel bss at %#lx, bss size %d\n",
- + start_mem + N_BSSADDR(kexec), kexec.a_bss );
- + printf ("\nKernel boot_info is at %#lx physical, %#lx virtual\n",
- + start_mem + kbi_offset, kexec.a_entry + kbi_offset);
- + printf ("\nKernel entry is %#x\n", kexec.a_entry );
- + printf ("ramdisk dest top is %#lx\n", start_mem + mem_size);
- + printf ("ramdisk lower limit is %#lx\n",
- + (u_long)(memptr + kexec.a_text + kexec.a_data + kexec.a_bss));
- + printf ("ramdisk src top is %#lx\n",
- + (u_long)(memptr + kexec.a_text + kexec.a_data + kexec.a_bss) +
- + rd_size);
- +
- + printf ("Type a key to continue the Linux boot...");
- + fflush (stdout);
- + getchar();
- + }
- +
- + printf("Booting Linux...\n");
- +
- + sync ();
- +
- + /* turn off interrupts... */
- + disable_interrupts();
- +
- + /* turn off caches... */
- + disable_cache();
- +
- + /* ..and any MMU translation */
- + disable_mmu();
- +
- + /* copy mover code to a safe place */
- + memcpy((void*)0x400, ©all, ©allend - ©all);
- +
- + /* setup stack */
- + change_stack((void*)PAGE_SIZE);
- +
- + /*
- + * On the Atari you can have two situations:
- + * 1. One piece of contiguous RAM (Falcon)
- + * 2. Two pieces of contiguous RAM (TT)
- + * In case 2 you can load your program into ST-ram and load your data in
- + * any old RAM you have left.
- + * In case 1 you could overwrite your own program when copying the
- + * kernel and ramdisk to their final positions.
- + * To solve this the mover code is copied to a safe place first.
- + * Then this program jumps to the mover code. After the mover code
- + * has finished it jumps to the start of the kernel in its new position.
- + * I thought the memory just after the interrupt vector table was a safe
- + * place because it is used by TOS to store some system variables.
- + * This range goes from 0x400 to approx. 0x5B0.
- + * This is more than enough for the miniscule mover routine (16 bytes).
- + */
- +
- + jump_to_mover((char *) start_mem, memptr,
- + (char *) start_mem + mem_size, memptr + memreq,
- + kexec.a_text + kexec.a_data + kexec.a_bss,
- + rd_size,
- + (void*)0x400);
- + for (;;);
- + /* NOTREACHED */
- + }
- +
- diff -cr --new-file linux-0.9pl1/tools/atari/bootstrap.h linux-0.9pl2/tools/atari/bootstrap.h
- *** linux-0.9pl1/tools/atari/bootstrap.h Wed Dec 31 19:00:00 1969
- --- linux-0.9pl2/tools/atari/bootstrap.h Fri Aug 5 12:47:23 1994
- ***************
- *** 0 ****
- --- 1,118 ----
- + /*
- + ** bootstrap.h -- This file is a part of the Atari bootloader.
- + **
- + ** Copyright 1993 by Arjan Knor
- + **
- + ** Modified by Andreas Schwab
- + ** - clear transparent translation registers
- + **
- + ** This file is subject to the terms and conditions of the GNU General Public
- + ** License. See the file README.legal in the main directory of this archive
- + ** for more details.
- + **
- + */
- +
- + #ifndef BOOTSTRAP_H
- + #define BOOTSTRAP_H
- +
- + /* _MCH cookie values */
- + #define MACH_ST 0
- + #define MACH_STE 1
- + #define MACH_TT 2
- + #define MACH_FALCON 3
- +
- + /* some constants for memory handling */
- + #define ST_RAM 0
- + #define TT_RAM 1
- + #define TT_RAM_BASE (u_long)(0x01000000)
- + #define MB (1024 * 1024)
- + #define START_MEM (bi.memory[0].addr)
- + #define MEM_SIZE (bi.memory[0].size)
- +
- + /* the various CPU- and FPU-types */
- + #define AFF_68000 (1)
- + #define AFF_68020 (2)
- + #define AFF_68030 (4)
- + #define AFF_68040 (8)
- + #define AFF_68881 (16)
- + #define AFF_68882 (32)
- +
- + /* the possible OS-languages */
- + #define USA 0
- + #define FRG 1
- + #define FRA 2
- + #define UK 3
- + #define SPA 4
- + #define ITA 5
- + #define SWE 6
- + #define SWF 7
- + #define SWG 8
- + #define TUR 9
- + #define FIN 10
- + #define NOR 11
- + #define DEN 12
- + #define SAU 13
- + #define HOL 14
- +
- + /* some inline functions */
- + /* TODO: update cache-control for '040 use */
- +
- + static __inline int fpu_idle_frame_size (void)
- + {
- + char fpu_frame[216];
- + __asm__ __volatile__ ("fnop"::);
- + __asm__ __volatile__ ("fsave %0@" : : "a" (fpu_frame));
- + return fpu_frame[1];
- + }
- +
- + static __inline void change_stack (u_long *stackp)
- + {
- + __asm__ volatile ("movel %0,sp\n\t" :: "g" (stackp) : "sp");
- + }
- +
- + static __inline void disable_interrupts (void)
- + {
- + __asm__ volatile ("orw #0x700,sr":);
- + }
- +
- + static __inline void disable_cache (void)
- + {
- + __asm__ volatile ("movec %0,cacr" :: "d" (0));
- + }
- +
- + static __inline void disable_mmu (void)
- + {
- + __asm__ volatile ("subl #4,sp\n\t"
- + "pmove tc,sp@\n\t"
- + "bclr #7,sp@\n\t"
- + "pmove sp@,tc\n\t"
- + "clrl sp@\n\t"
- + ".long 0xf0170800\n\t" /* pmove sp@,tt0 */
- + ".long 0xf0170c00\n\t" /* pmove sp@,tt1 */
- + "addl #4,sp\n");
- + }
- +
- + static __inline void jump_to_mover (void *, void *, void *, void *, int, int,
- + void *) __attribute__ ((noreturn));
- + static __inline void jump_to_mover (void *kernel_start, void *mem_start,
- + void *ramdisk_end, void *mem_end,
- + int kernel_size, int ramdisk_size,
- + void *mover_addr)
- + {
- + asm volatile ("movel %0,a0\n\t"
- + "movel %1,a1\n\t"
- + "movel %2,a2\n\t"
- + "movel %3,a3\n\t"
- + "movel %4,d0\n\t"
- + "movel %5,d1\n\t"
- + "jmp %6@\n"
- + : /* no outputs */
- + : "g" (kernel_start), "g" (mem_start),
- + "g" (ramdisk_end), "g" (mem_end),
- + "g" (kernel_size), "g" (ramdisk_size),
- + "a" (mover_addr)
- + : "a0", "a1", "a2", "a3", "d0", "d1");
- + }
- +
- + #endif /* BOOTSTRAP_H */
- +
- diff -cr --new-file linux-0.9pl1/tools/atari/get_nlist.c linux-0.9pl2/tools/atari/get_nlist.c
- *** linux-0.9pl1/tools/atari/get_nlist.c Wed Dec 31 19:00:00 1969
- --- linux-0.9pl2/tools/atari/get_nlist.c Fri Aug 5 12:47:24 1994
- ***************
- *** 0 ****
- --- 1,97 ----
- + /*
- + ** get_nlist.c -- This file contains the routines for getting a symbol
- + ** table entry when booting the Amiga Linux kernel.
- + **
- + ** Copyright 1993 by Hamish Macdonald, Arjan Knor
- + **
- + ** This file is subject to the terms and conditions of the GNU General Public
- + ** License. See the file README.legal in the main directory of this archive
- + ** for more details.
- + **
- + */
- +
- +
- + #include <stdlib.h>
- + #include <stdio.h>
- + #include <fcntl.h> /* has to be sys/fcntl.h ?? */
- + #include <unistd.h>
- + #include <linux/a.out.h>
- +
- + struct nlist *get_nlist (const char *fname, const char *symname)
- + {
- + int fd = open (fname, O_RDONLY);
- + struct exec ex;
- + struct nlist *nl, *p = NULL, *syms;
- + char *strs;
- + long filesize;
- + long strsize, numsyms;
- +
- + if (fd == -1)
- + return NULL;
- +
- + #ifdef DEBUG
- + printf ("fd is %d\n", fd);
- + #endif
- +
- + read (fd, &ex, sizeof(ex));
- + if (!ex.a_syms) {
- + close (fd);
- + return NULL;
- + }
- +
- + #ifdef DEBUG
- + printf ("%d bytes of symbol data\n", ex.a_syms);
- + #endif
- +
- + syms = (struct nlist *)malloc (ex.a_syms);
- + if (!syms) {
- + close (fd);
- + return NULL;
- + }
- + lseek (fd, N_SYMOFF(ex), SEEK_SET);
- + read (fd, syms, ex.a_syms);
- + numsyms = ex.a_syms / sizeof (struct nlist);
- + #ifdef DEBUG
- + printf ("there are %d symbols\n", numsyms);
- + #endif
- +
- + filesize = lseek (fd, 0L, SEEK_END);
- + #ifdef DEBUG
- + printf ("there are %d characters in the file\n", filesize);
- + #endif
- + strsize = filesize - N_STROFF(ex);
- + #ifdef DEBUG
- + printf ("%d characters in the string table\n", strsize);
- + #endif
- +
- + strs = (char *)malloc (strsize);
- + if (!strs) {
- + free (syms);
- + close (fd);
- + return NULL;
- + }
- + lseek (fd, N_STROFF(ex), SEEK_SET);
- + read (fd, strs, strsize);
- +
- + for (nl = syms; nl < syms + numsyms; nl++) {
- + #ifdef DEBUG
- + printf ("checking symbol number %d, name %s\n",
- + nl - syms, strs + nl->n_un.n_strx);
- + #endif
- + if (strcmp (symname, strs + nl->n_un.n_strx) == 0
- + && nl->n_type == N_BSS | N_EXT) {
- + p = (struct nlist *)malloc (sizeof (struct nlist)
- + + strlen(strs + nl->n_un.n_strx) + 1);
- + if (!p)
- + break;
- + *p = *nl;
- + p->n_un.n_name = (char *)(p+1);
- + strcpy (p->n_un.n_name, strs + nl->n_un.n_strx);
- + }
- + }
- +
- + free (strs);
- + free (syms);
- + close (fd);
- + return p;
- + }
- diff -cr --new-file linux-0.9pl1/tools/atari/sysvars.h linux-0.9pl2/tools/atari/sysvars.h
- *** linux-0.9pl1/tools/atari/sysvars.h Wed Dec 31 19:00:00 1969
- --- linux-0.9pl2/tools/atari/sysvars.h Fri Aug 5 12:47:24 1994
- ***************
- *** 0 ****
- --- 1,22 ----
- + typedef struct _osheader
- + {
- + unsigned short os_entry;
- + unsigned short os_version;
- + void *reseth;
- + struct _osheader *os_beg;
- + void *os_end;
- + long os_rsv1;
- + void *os_magic;
- + long os_date;
- + unsigned short os_conf;
- + unsigned short os_dosdate;
- + char **p_root;
- + unsigned char **pkbshift;
- + void **p_run;
- + char *p_rsv2;
- + } OSHEADER;
- +
- + #define phystop ((unsigned long *)0x42e)
- + #define _sysbase ((OSHEADER **)0x4f2)
- + #define _p_cookies ((unsigned long **)0x5a0)
- + #define ramtop ((unsigned long *)0x5a4)
-